Professional Documents
Culture Documents
Interrupt Summary
11/09/2015
Interrupt handler
11/09/2015
Interrupt Setup
Initialise hardware
NVIC_EnableIrq(int interruptIndex)
11/09/2015
SysTick Timer
11/09/2015
Hardware
SysTick->LOAD
Reference
clock
Reload register
CPU
SysTick->VAL
0
1
Core clock
Interrupt Request
ENABLE_MASK
SysTick->CTRL
CLKSOURCE_MASK
Control
TICKINT_MASK
Software Routine
uint32_t SysTick_Config(uint32_t ticks) {
if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) {
/* Reload value impossible */
return (1);
}
/* Set reload register */
SysTick->LOAD = ticks - 1;
Code to
/* Configure Systick */
SysTick->CTRL =
SysTick_CTRL_CLKSOURCE_Msk |
SysTick_CTRL_TICKINT_Msk
|
SysTick_CTRL_ENABLE_Msk;
/* Function successful */
return (0);}
11/09/2015
Vector Table
...
void SysTick_Handler(void) WEAK_DEFAULT_HANDLER;
...
VectorTable const __vector_table = {
/* omitted rows */
SVC_Handler,
/* System Service Call via SVC instruction */
Vector table entry for
DebugMon_Handler, /* Debug Monitor*/
Timer
0,
/* Reserved SysTick
*/
PendSV_Handler,
/* Pendable request for system service */
SysTick_Handler,
/* System Tick Timer */
/* External Interrupts */
DMA0_IRQHandler,
/* DMA channel 0 interrupt
DMA1_IRQHandler,
/* DMA channel 1 interrupt
/* omitted rows */
};
*/
*/
SysTick Handler
Code to
Handle Tick
/*
* This function is used for the
* System Timer interrupt handler.
*/
void SysTick_Handler(void) {
...
}
Name agrees with
Vector Table entry
11/09/2015
10