NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
StarterWare DMTimer
DMTimer[edit]
Introduction[edit]
DMTimer is a 32 bit timer and the module contains a free running upward counter with auto reload capability on overflow. The timer counter can be read and written in real-time (while counting). The timer module includes compare logic to allow an interrupt event on a programmable counter matching value.
Programming[edit]
- DMTimer can be configured in two modes of operation. They are
- Timer Mode
- Compare Mode
- To enable the DMTimer to operate in Timer mode, the following sequence has to be followed.
- Configure the timer for One-shot or Auto-reload operation by calling the API DMTimerModeConfigure().
- Load the count value for the timer by calling the API DMTimerCounterSet().
- If Auto-reload operation is enabled then use the API DMTimerReloadSet() to load the reload value.
- Enable the timer interrupts by using the API DMTimerIntEnable().
- Start/Enable the timer by calling the API DMTimerEnable(). The timer will start counting.
- Stop/Disable the timer by calling the API DMTimerDisable(). The timer will stop counting.
- To enable the DMTimer to operate in Compare mode, the following sequence has to be followed.
- Load the compare value to the compare register by calling the API DMTimerCompareSet.
- Configure the timer in one shot with compare enable mode or auto reload with compare enable mode by calling the DMTimerModeConfigure API.
- Load the count value for the timer by calling the API DMTimerCounterSet().
- If Auto-reload operation is enabled then use the API DMTimerReloadSet() to load the reload value.
- Enable the timer interrupts by using the API DMTimerIntEnable().
- Start/Enable the timer by calling the API DMTimerEnable(). The timer will start counting.
- Stop/Disable the timer by calling the API DMTimerDisable().