![Texas Instruments AM1808 Скачать руководство пользователя страница 1475](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581475.webp)
Introduction
1475
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
64-Bit Timer Plus
30.1.5.4.2.1.1 Enabling the 32-Bit Timer Chained Mode
The TIM12RS and TIM34RS bits in TGCR determine whether the timer is in reset, or if it is capable of
operating. The TIM12RS bit controls the reset of the timer 1:2 side of the timer and the TIM34RS bits
control the reset of the timer 3:4 side of the timer. For the timer to operate, the TIM12RS and TIM34RS
bits must be set to 1.
The ENAMODE12 bit in the timer control register (TCR) controls whether the timer is disabled, enabled to
run once, enabled to run continuously, or enabled to run continuously with period reload; the
ENAMODE34 bit has no effect in 32-bit timer chained mode. When the timer is disabled (ENAMODE12 =
0), the timer does not run and maintains its current count value. When the timer is enabled for one time
operation (ENAMODE12 = 1), it counts up until the counter value equals the period value and then stops.
When the timer is enabled for continuous operation (ENAMODE12 = 2h), the counter counts up until it
reaches the period value, then resets itself to zero and begins counting again. When the timer is enabled
for continuous operation with period reload (ENAMODE12 = 3h), the counter counts up until it reaches the
period value, then resets itself to zero, reloads the period registers (PRD12 and PRD34) with the value in
the period reload registers (REL12 and REL34), and begins counting again.
shows the bit values in TGCR to configure the 32-bit timer in chained mode.
Table 30-3. 32-Bit Timer Chained Mode Configurations
32-Bit Timer Configuration
TGCR Bit
TCR Bit
TIM12RS
TIM34RS
ENAMODE12
To place the 32-bit timer chained mode in reset
0
0
0
To disable the 32-bit timer chained mode (out of reset)
1h
1h
0
To enable the 32-bit timer chained mode for one-time operation
1h
1h
1h
To enable the 32-bit timer chained mode for continuous operation
1h
1h
2h
To enable the 32-bit timer chained mode for continuous operation with period
reload (Timer 3 only)
1h
1h
3h
Once the timer stops, if an external clock is used as the timer clock, the timer must remain disabled for at
least one external clock period or the timer will not start counting again. When using the external clock,
the count value is synchronized to the internal clock.
Note that when both the timer counter and timer period are cleared to 0, the timer can be enabled but the
timer counter does not increment because the timer period is 0.
30.1.5.4.2.1.2 32-Bit Timer Chained Mode Configuration Procedure
To configure the GP timer to operate as a dual 32-bit chained mode timer, follow the steps below:
1. Select 32-bit chained mode (TIMMODE in TGCR).
2. Remove the timer from reset (TIM12RS and TIM34RS in TGCR).
3. Select the desired timer period (PRD12). Program with the desired timer period value - 1.
4. Select the desired timer prescaler value (PRD34).
5. Enable the timer (ENAMODE12 in TCR).
6. If ENAMODE12 = 3h, write the desired timer period for the next timer cycle in the period reload
registers (REL12 and REL34). Program with the desired timer period value - 1. This step can be done
at any time before the current timer cycle ends.