11.07.2015 Views

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Basic conceptsTasksIn this context, a task is a program running on the CPU core of a microcontroller. Without a multitasking kernel (an<strong>RTOS</strong>), only one task can be executed by the CPU at a time. This is called a single-task system. A real-time operatingsystem allows the execution of multiple tasks on a single CPU. All tasks execute as if they completely "owned" theentire CPU. The tasks are scheduled, meaning that the <strong>RTOS</strong> can activate and deactivate every task.Single-task systems (superloop)A superloop application is basically a program that runs in an endless loop, calling OS functions to execute theappropriate operations (task level). No real-time kernel is used, so interrupt service routines (ISRs) must be used forreal-time parts of the software or critical operations (interrupt level). This type of system is typically used in small,uncomplex systems or if real-time behavior is not critical.Task levelInterrupt levelSuperloopISRTimeISRISR (nested)Of course, there are fewer preemption and synchronization problems with a superloop application. Also, because noreal-time kernel is used, only one stack exists in ROM, meaning that ROM size is smaller and less RAM is occupiedfor stacks. However, superloops can become difficult to maintain if the program becomes too large. Because onesoftware component cannot be interrupted by another component (only by ISRs), the reaction time of one componentdepends on the execution time of all other components in the system. Real-time behavior is therefore poor.Multitasking systemsIn a multitasking system, there are different scheduling systems in which the calculation power of the CPU can bedistributed among tasks.PP<strong>RTOS</strong>-2 13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!