2010-02-05 12:57 AM
used interrupt with keil
2011-05-17 04:39 AM
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)