Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
stm32:peripherals:nvic [2016/10/06 09:46] – created feur | stm32:peripherals:nvic [2022/12/27 18:53] (current) – ruan | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Nested Vectored Interrupt Controller ====== | + | ====== Nested Vectored Interrupt Controller |
The NVIC manages all the interrupts and is closely coupled to the processor core. \\ | The NVIC manages all the interrupts and is closely coupled to the processor core. \\ | ||
+ | A list of all available interrupts: [[interrupt_table|interrupt table]]. \\ | ||
\\ {{nvic_complete.svg? | \\ {{nvic_complete.svg? | ||
Line 10: | Line 11: | ||
* 16 programmable priority levels. | * 16 programmable priority levels. | ||
* low-latency exceptions and interrupt handling. | * low-latency exceptions and interrupt handling. | ||
+ | \\ | ||
+ | |||
+ | |||
+ | ===== Configuration Register ===== | ||
+ | |||
+ | Table of interrupt numbers: [[interrupt_table| IRQ numbers]]. \\ \\ | ||
+ | ==== NVIC - ISERx ==== | ||
+ | |||
+ | === ISER0 - Interrupt set enable register 0 === | ||
+ | |||
+ | \\ {{nvic_reg_iser1.svg}} \\ \\ | ||
+ | |||
+ | === ISER1 Interrupt set enable register 1 === | ||
+ | |||
+ | \\ {{nvic_reg_iser2.svg}} \\ \\ | ||
+ | |||
+ | === ISER2 - Interrupt set enable register 2 === | ||
+ | |||
+ | \\ {{nvic_reg_iser3.svg}} \\ \\ | ||
+ | |||
+ | |< 100% 5em 5em >| | ||
+ | |SETENA*|1|Enable interrupt (unmask interrupt)| | ||
+ | //*Setting this bit to 0 has no effect, refer to [[#ICER]]// \\ | ||
+ | |||
+ | ==== NVIC - ICERx ==== | ||
+ | |||
+ | === ICER0 - Interrupt clear enable register 0 === | ||
+ | |||
+ | \\ {{nvic_reg_icer1.svg}} \\ \\ | ||
+ | |||
+ | === ICER1 - Interrupt clear enable register 1 === | ||
+ | |||
+ | \\ {{nvic_reg_icer2.svg}} \\ \\ | ||
+ | |||
+ | === ICER2 - Interrupt clear enable register 2 === | ||
+ | |||
+ | \\ {{nvic_reg_icer3.svg}} \\ \\ | ||
+ | |||
+ | |< 100% 5em 5em >| | ||
+ | |CLRENA*|1|Disable interrupt (mask interrupt)| | ||
+ | //*Setting this bit to 0 has no effect, refer to [[#ISER]]// | ||
+ | |||
+ | ===== Programming Example ===== | ||
+ | |||
+ | For external interrupts via GPIO pins go to the [[exti|EXTI]] page. \\ | ||
+ | |||
+ | ==== Setup Peripheral (e.g. Timer 2) ==== | ||
+ | |||
+ | <code c> | ||
+ | #include " | ||
+ | |||
+ | RCC-> | ||
+ | |||
+ | /* configure timer */ | ||
+ | TIM2-> | ||
+ | TIM2-> | ||
+ | TIM2-> | ||
+ | |||
+ | TIM2-> | ||
+ | </ | ||
+ | \\ | ||
+ | |||
+ | ==== Setup NVIC ==== | ||
+ | |||
+ | <code c> | ||
+ | #include " | ||
+ | |||
+ | NVIC-> | ||
+ | </ | ||
+ | \\ | ||
- | ===== Functions ===== |