Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 11 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:
1 Answer
7 years, 11 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 20 Jun 2016A 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 20 Jun 2016