RL-ARM User's Guide

Hardware Timer

The following #defines specify how the RTX kernel's hardware timer is configured:

  • OS_TIMER specifies the on-chip timer used as a time-base for the real-time system. It delivers a periodic interrupt that wakes up a time-keeping system task. The user can choose which timer serves this purpose. Use 0 for Timer 0, or 1 for Timer 1.
    #define OS_TIMER       1
    
  • OS_CLOCK specifies the input clock frequency for the selected timer. This value is calculated as: f(xtal) / VPBDIV. Example is for 15 MHz at @ 60 MHz CPU clock and VPBDIV = 4
    #define OS_CLOCK       15000000
    
  • OS_TICK specifies the timer tick interval in µsec. Recommended values are 1000 to 100000. The resulting interval is from 1 ms to 100 ms. Default configuration is for 10 ms.
    #define OS_TICK        10000
    

Note

  • Hardware Timer configuration is required only for ARM7™ and ARM9™ RTX Library version. The Cortex™-M version uses a common SysTick timer for all Cortex™-M device variants.