![](http://datasheet.mmic.net.cn/30000/MB89P475P-SH-101_datasheet_2367370/MB89P475P-SH-101_251.png)
235
CHAPTER 10 8/16-BIT TIMER/COUNTER
10.3.3
Timer 11/21 Data Register (T1/3DR)
The Timer 11/21 data register (T1/3DR) are used to set all or part of the interval time or
counter value, and to read out all or part of the counter value, depending on the mode
and function being used. In 8-bit mode, it sets the Timer 11/21 interval time (interval
timer function) or counter value (counter function), and reads out the counter value. In
16-bit mode, it sets the 8 LSBs of the 16-bit timer interval (interval timer function) or
counter value (counter function), and reads out the counter value.
I Timer 11/21 data register (T1/3DR)
The value set into this register is compared with the counter value (count). If you read the register, you get
the current counter value. The register setting cannot be read out.
Figure 10.3-5 "Timer 11/21 data register (T1/3DR)" shows the bit structure of the Timer 11/21 data
register.
Figure 10.3-5 Timer 11/21 data register (T1/3DR)
G 8-bit mode (Timer 11/21)
The value in this register is compared with the count in the timer 11/21 counter. For the interval timer
function it sets the interval time, and for the counter function, it sets the count to be detected. When count
operation enabled (T1/3CR: T1STR = 0 --> 1, T1STP = 0), the value in the T1/3DR register is loaded into
the comparison data latch, and the counter starts counting up.
When the counter counts up to where it matches the value in the comparison data latch, the value in the T1/
3DR register is re-loaded into the comparison data latch, and the counter is cleared and continues to count.
Since the comparison data latch is reloaded when a match is detected, if a new value is loaded into the T1/
3DR register while the counter is counting, the new value will not take effect until the next count cycle
(after a match is detected in the current cycle).
Reference:
The T1/3DR setting for interval timer operation can be calculated using the following formula. (The
instruction cycle time is affected by the clock mode, and the speed-shift selection.)
T1/3DR register value = interval time/(count clock cycle x instruction cycle) - 1
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Initial value
001BH
0017H
XXXXXXXXB
R/W
R/W : Readable and writable
X: Indeterminate