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.

Configuration for your targetsystemIntroductionYou do not have to configure anything to get started with <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>. The start project supplied will executeon your system.The file <strong>RTOS</strong>INIT.c is provided in source code and can be modified to match your target hardware needs. It iscompiled and linked with your application program.Hardware-specific routinesRoutineOS_InitHW()OS_Idle()OS_GetTime_Cycles()OS_ISR_Tick()Table 116: Hardware specific routinesDescriptionInitializes the hardware timer used for generating interrupts. <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>needs a timer-interrupt to determine when to activate tasks that wait for theexpiration of a delay, when to call a software timer, and to keep the time variable upto-date.The idle loop is always executed whenever no other task (and no interrupt serviceroutine) is ready for execution.Reads the timestamp in cycles. Cycle length depends on the system.The <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> timer-interrupt handler. When using a different timer, alwayscheck the specified interrupt vector.Configuration definesFor most embedded systems, configuration is done by simply modifying the following defines, located at the top of the<strong>RTOS</strong>Init.c file:DefineDescriptionOS_FSYSSystem frequency (in Hz).Example: 20000000 for 20MHz.Table 117: Configuration defines overviewHow to change settingsThe only file which you may need to change is <strong>RTOS</strong>Init.c. This file contains all hardware-specific routines. The oneexception is that some ports of <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> require an additional interrupt vector table file (details can befound in the CPU & Compiler Specifics manual of <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> documentation).SETTING THE SYSTEM FREQUENCY OS_FSYSRelevant definesOS_FSYSFor most systems it should be sufficient to change the OS_FSYS define at the top of <strong>RTOS</strong>Init.c.PP<strong>RTOS</strong>-2 111

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

Saved successfully!

Ooh no, something went wrong!