Could you please send me a snippet of code to set up the NVIC to use an ISR & trigger the ISR ?
Get yourself a copy of the very informative book "The Definitive Guide to ARM® Cortex®-M3 and Cortex®-M4 Processors":
https://www.amazon.com/Definitive-Guide-Cortex%C2%AE-M3-Cortex%C2%AE-M4-Processors/dp/0124080820/ref=sr_1_4?keywords=programming+cortex-m4&qid=1582569985&sr=8-4
It explains all with a lot of code.
Hi Bastian
I have the book but the examples available from the Book Web page only start on Chapter 10. But as the Interrupts are on Chapter 7 then there are no examples to see regarding the interrupts. Any idea why the examples only start on Chapter 10. Or how can I get the examples from the other chapters 1 to 9.?
many thanks
Chapter 7 has an example of setting up interrupts right in the chapter as well as an English description of what it is doing. (Page 268 of the 3rd edition has a "simple" setting up of an interrupt example. )
It goes like this
// No need to set priority grouping just yet, use the default
// No need to set the priority just yet, use the default
NVIC_EnableIRQ(IRQn);
If you want to execute this interrupt through software
NVIC_SetPendingIRQ(IRQn);
Normally the hardware would assert the interrupt pending and not the software, but this would let you test the IRQ out.
When the Interrupt happens the processor will enter the Exception sequence ending with loading the PC with the address in the Vector Table at index (IRQn + 16)
Hi Robert
many thanks for your response here. I can use this information. But do you have the Chapters of 1 to 9 from the Book by Joseph Yiu ? It is so that if you download the Zip file of examples from the Book Web page then only Chapters 10 to 23 are available.
thanks
Besides the book's examples there are plenty of example projects around there where you can learn about the NVIC. For example ST's Cube library.
42Bastian Schick said:there are plenty of example projects around
Indeed!
Lots of examples & training materials from both Keil & ST:
community.arm.com/.../109675