Initialization of the Timer Manager must include the following steps:
- Set the number of timers to be used. TIMERMGR_CNTL[10-1] MAX_TIMER
- This controls the loop over the timer RAM and is the highest ID timer that will be used in the operation of the Timer Manager (MAX_TIMER + 1 is the total number of timers in use)
- This number must not change during the course of operation; it can only be changed when TIMERMGR_CNTL[0] ENABLE = 0. It is assumed that the user will set the MAX_TIMER value as required.
- This step can be skipped if using all timers. MAX_TIMER defaults to 1024 (that is, all timers in use).
- Write output event mapping for all timers to the
DMSS. This must be done before enabling timer
manager and must not be done again once the timer
manager has been enabled.
- Write initial setup values to the TIMERMGR_SETUP_j_k registers. All timers that will be used initially must have a setup value before the Timer Manager is enabled.
- Enable individual timers. There are two ways to do this.
- To enable all timers, use the TIMERMGR_CNTL[12] MASS_ENABLE bit. This will enable all timers from 0 to MAX_TIMER.
- Note that MAX_TIMER and MASS_ENABLE should be set in successive writes, or the previous value of MAX_TIMER will be used for MASS_ENABLE
- MASS_ENABLE must only be used during initialization.
- Alternately, individual timers can be enabled or disabled with TIMERMGR_CONTROL_j_k
- It is therefore faster to set the individual TIMERMGR_CONTROL_j_k bits if more than half of the in-use timers are to be enabled initially. If more than half of the in-use timers are to be enabled initially, it is faster to use MASS_ENABLE and then disable specific timers with the TIMERMGR_CONTROL_j_k bits.
- Enable the timer manager. Set TIMERMGR_CNTL[0] ENABLE to 1.