Timer Diagram; Programming The Timer - Texas Instruments OMAP5910 Technical Reference Manual

Dual-core
Hide thumbs Also See for OMAP5910:
Table of Contents

Advertisement

6.2.1

Programming the Timer

Figure 6–3. Timer Diagram
TIMER_CLK
TIMER
TIMER_IRQ
If LOAD_TIM = 0 and AR (auto-reload mode) = 1, the timer is always 0 and can
never decrement. Here the timer interrupt is asserted and stays asserted all
the time. Since the timer interrupts are edge-senditive, only one interrupt is
recognized because there is one initial edge, and then the interrupt is asserted
constantly.
Before a timer can be used, you must enable its internal clock by setting the
CLOCK_ENABLE bit of the control timer register (CNTL_TIMER) to 1. A timer
is started by setting the ST field of the control timer register (CNTL_TIMER)
to 1. It is stopped by resetting this bit to 0. When the timer is stopped, the
content of the decrementer is frozen.
If the autoreload bit is disabled (AR field of control timer register (CNTL_TIM-
ER) is 0), the timer decrements from the loaded value down to zero and then
stops. If the autoreload bit is enabled (AR=1), the timer continues. A new value
(from the load register) is loaded into the timer when it passes though zero or
when it starts. An interrupt is produced when the corresponding timer passes
through zero.
To avoid undefined results, do not change the settings of the PTV or AR fields
of the control timer register (CNTL_TIMER) or the LOAD_TIM register while the
timer is running.
The timer value is held in the VALUE_TIM field of the READ_TIM and can be
read while the timer is running or stopped.
4
3
2
1
MPU Private Peripherals
Timer Description
0
15
6-5

Advertisement

Table of Contents
loading

Table of Contents