Professional Documents
Culture Documents
Interrupt Numbers and NVIC Registers
Interrupt Numbers and NVIC Registers
&
NVIC Registers
1
2303ENG Embedded Systems(NA and GC)
Interrupt numbers
Determine interrupt
number for port/device.
Programmatically
Regnum = int(INTNUM/32); BitPosition=INTNUM%32
NVIC->DIS[Regnum]=(1<<BitPosition) ;
NVIC Interrupt EN registers
Define NVIC_EN as 0xE000E100
Can access as NVIC_EN[0] for NVIC_EN0
(Interrupt set-enable registers) Can access as NVIC_EN[1] for NVIC_EN1 etc
►32-bit registers which can force interrupts into pending state, and show
which interrupts are pending.
►For a particular device, there is a single set pending bit associated with it.
►32-bit registers which can clear pending state from interrupts, and show which
interrupts are pending.
►For a particular device, there is a single clear pending bit associated with it.
Programmatically
Regnum = int(INTNUM/4); INTABCD=(INTNUM%4)
Eg Setting Priority
Question
If we want a high priority (say 1) for UART 6, which register and bits should be set?
Solution
UART 6 = interrupt number 59
NVIC_PRI14
1 0
External GPIO Interrupts : Basic method
1. Disable ALL interrupts