4 years, 9 months ago.

ADC NVIC set up compile problem

Hi, I am trying to use an NXP application note code for an inverter application but the compiler does not like the following register names:

NVICIP58 = 0x30; setting interrupt of ADC1 NVICICPR1|=1<<26; clear the pending register of interrupt source 58 NVICISER1|=1<<26; set the interrupt source of ADC1

Does anyone know how to fix this issue, or what I might be doing wrong? Thanks in advance

Question relating to:

The Freedom-K64F is an ultra-low-cost development platform for Kinetis K64, K63, and K24 MCUs.

1 Answer

4 years, 9 months ago.

Which application note is this? And normally you use these functions to enable/disable IRQs: https://www.keil.com/pack/doc/cmsis/Core/html/group___n_v_i_c__gr.html

It is from a note on the FlexTimer: Document Number AN5142. All the other code has been so far recognized by the compiler (for PWM etc.).

Thanks for the link, I will try to use these functions instead. If you read the document I would be interested to know why it doesn't work just for those registers. All fairly new stuff for me.

posted by jesse cottrell 20 Jun 2016

A google on those names resulted only (former) Freescale results. While the NVIC is part of the ARM core and should be common for every single ARM MCU. (At least every MCU with the same ARM core).

It seems these ones are from the C-style header files, while mbed uses the C++ style ones, so this should work: (I don't know if C/C++ style is correct description btw :P)

NVIC->ICPR[1] |= 1<<26;

Here they are defined for an M4: https://github.com/mbedmicro/mbed/blob/master/hal/targets/cmsis/core_cm4.h#L416

posted by Erik - 20 Jun 2016

That has done the trick, and I have learned something! Your Google must work better than mine because I tried for ages to find something...guess it helps to know what you are looking for :)

Thank you.

posted by jesse cottrell 20 Jun 2016