MDK-ARM Keil, MDK-ARM Datasheet - Page 30

KIT REALVIEW MCU DEVELOPMENT

MDK-ARM

Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Datasheets

Specifications of MDK-ARM

For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
30
ARM7/9-based microcontrollers do not support nested interrupts without
additional software to avoid potential deadlocks and any system based on nested
interrupts has an unpredictable stack usage. With an RTX-based application, it is
best to implement the interrupt service code as a task and assign it a high priority.
The first line of code in the interrupt task should make it wait for an event flag.
When an interrupt occurs, the ISR simply sets the event flag and terminates. This
schedules the interrupt task, which services the interrupt and then goes back to
waiting for the next event flag to be set.
Within the RTX RTOS, interrupt
code is run as tasks. The
interrupt handlers signal the tasks
when an interrupt occurs. The
task priority level defines which
task gets scheduled by the kernel.
The RTX RTOS has an event set
call, which is designed for use within an interrupt handler.
void isr_evt_set (unsigned short event_flags, OS_TID task);
A typical task intended to handle interrupts will have the following structure:
void Task3 (void)
}
The actual interrupt source will contain a minimal amount of code.
void IRQ_Handler (void) __irq
}
Exercise: Interrupt Events
This exercise demonstrates how to integrate interrupt handling into an RTX-
based application by using event flags.
while (1)
}
isr_evt_set (0x0001, tsk3);
EXTINT = 0x00000002;
VICVectAddr = 0x00000000;
os_evt_wait_or (0x0001, 0xffff);
{
{
{
// Signal Task 3 with an event
// Clear the peripheral interrupt flag
// Signal end of interrupt to the VIC
// Wait until ISR triggers an event
// Handle the interrupt
// Loop and go back to sleep
Chapter 2. Developing With an RTOS

Related parts for MDK-ARM