MB89190/190A series
Chapter 7 8-/16-bit Timer/Counter
7-13
7.4 Registers for the 8-/16-bit Timer/Counter
7.4.3 Timer 1 Data Register (T1DR)
The timer 1 data register (T1DR) is used to set the 8-bit mode timer 1, or 16-bit
mode lower 8-bit interval timer value (when the interval timer function is working),
or the counter value (when the counter function is working), and to read the
counter value.
T Timer 1 data register (T1DR)
The value set in this register is compared to the counter value. When this register is read, the current
counter value is read. The setting of this register cannot be read.
Figure 7.4.3 shows the bit configuration of the timer 1 data register.
Fig. 7.4.3 Timer 1 Data Register (T1DR)
In 8-bit mode (timer 1)
The value of this register is compared to the timer 1 counter value. When the interval timer function is
working, the interval time value is set. When the counter function is working, the count value to be
detected is set. When the count operation is enabled (T1CR: T1STR = 0
→ 1, T1STP = 0), the T1DR
register value is set (loaded) to the comparate data latch, and incrementing starts.
When the
comparate data latch value and the counter value match each other during incrementing the T1DR
register value is reset to the comparate data latch, the counter is cleared, and the count continues.
The comparate data latch is reset by match detection, so when a value is written to the T1DR register
during counter operation, it becomes valid from the next cycle (after match detection).
Remark:
The T1DR register setting during the interval timer operation can be calculated from the
following expression. However, the instruction cycle is the original oscillation divided by 4
(4/Fc).
T1DR register value = interval time/(count clock cycle
× instruction cycle) 1
In 16-bit mode
The value of this register is compared to the lower 8-bit count value of the 16-bit timer. When the
interval timer function is working, the interval time lower 8 bits are set. When the counter function is
working, the lower 8 bits of the count value to be detected are set. The T1DR register is loaded to the
lower 8 bits of the comparate data latch when the count operation starts and when a match with the
16-bit counter value is detected. When a value is written to the T1DR register during operation of the
16-bit counter, it becomes valid after detection of a match.
Reference:
For the T1DR register setting during the interval timer function operation, see
Section
7.4.4.
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Initial value
001BH
XXXXXXXXB
R/W
:
Read and Write
X
:
Undefined