Initialization of the Timer Manager must include the following steps:
- Set the number of timers to be used. TIMER_MGR_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 TIMER_MGR_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 TIMER_MGR_TIMERS_PAGE_ENTRY_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 TIMER_MGR_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 TIMER_MGR_TIMERS_PAGE_ENTRY_CONTROL_J_K
- Enable the timer manager. Set TIMER_MGR_CNTL[0] ENABLE to 1.