cancel
Showing results for 
Search instead for 
Did you mean: 

used interrupt with keil

ludovic-micou2
Associate III
Posted on February 05, 2010 at 09:57

used interrupt with keil

1 REPLY 1
Tomas DRESLER
Senior II
Posted on May 17, 2011 at 13:39

Interrupts are rather straightforward, you have to:

a) configure a peripheral that raises interrupts

b) enable the interrupt generation in this peripheral

c) enable the interrupt in NVIC and set it's priority

d) write the interrupt handler function that handles interrupt and clears the interrupt flag in the peripheral

No need for clearing anything in NCIC etc., the IRQ handler is standard C routine, no keywords before and after.

Look at some Keil examples, e.g. \Keil\ARM\Boards\Keil\MCBSTM32\USART_Irq\ and inspire yourself!

The IRQ routine names/addresses can be found in STM32F10x.s in the vector table definition, you can create a C function with the same name to override the defualt link (e.g. USART1_IRQHandler in usart.c)