>Within ARMBASIC how are the Interrupt priorities currently set, mainly in reference to Systemtick, Uarts EINT0 and timers.
>Can WAIT() and WAITMICRO() be used freely within an interrupt service routine?
For almost all chips I've worked with,
SysTick and other system interrupts are not part of the priority scheme.
I saw a case recently (which we don't use) where Systick, HardFault, etc had a priority register.
You would need to verify in the Interrupt Priority Register section of the individual User Manual.
I think Systick, HardFault, etc receive the highest priority.
I did a test to verify but that was many years ago.
By default all other priorities are FF, lowest.
Bellow is a basic example to set priorities to different levels.
Note: the lower 3 bits of each 8 bit value are not used so the actual priority is >> 3.
Code: Select all
' Interrupt Priority Registers from LPC40xx.bas
#define NVIC_IP0 *&HE000E400
#define NVIC_IP1 *&HE000E404
#define NVIC_IP2 *&HE000E408
#define NVIC_IP3 *&HE000E40C
#define NVIC_IP4 *&HE000E410
#define NVIC_IP5 *&HE000E414
#define NVIC_IP6 *&HE000E418
#define NVIC_IP7 *&HE000E41C
#define NVIC_IP8 *&HE000E420
#define NVIC_IP9 *&HE000E424
#define NVIC_IP10 *&HE000E428
sub Config
' set interrupt priorities
' Timer1 priority = 0 highest
' Timer2 priority = 4 (&H20 >> 3)
' Timer3 priority = 6 (&H30 >> 3)
' set all other interrupt priorities to lowest
NVIC_IP0 = &H2000FFFF
NVIC_IP1 = &HFFFFFF30
NVIC_IP2 = &HFFFFFFFF
NVIC_IP3 = &HFFFFFFFF
NVIC_IP4 = &HFFFFFFFF
NVIC_IP5 = &HFFFFFFFF
NVIC_IP6 = &HFFFFFFFF
NVIC_IP7 = &HFFFFFFFF
NVIC_IP8 = &HFFFFFFFF
NVIC_IP9 = &HFFFFFFFF
NVIC_IP10 = &HFFFFFFFF
' other stuff .....
end sub