
7721 Group User’s Manual
TIMER B
9–3
9.2 Block description
9.2.1 Counter and reload register (timer Bi register)
Each of timer Bi counter and reload register consists of 16 bits and has the following functions.
(1)
Functions in timer mode and event counter mode
Countdown in the counter is performed each time the count source is input. The reload register is
used to store the initial value of the counter. When a counter underflow occurs, the reload register’s
contents are reloaded into the counter.
A value is set to the counter and reload register by writing the value to the timer Bi register. Table
9.2.1 lists the memory assignment of the timer Bi register.
The value written into the timer Bi register when the counting is not in progress is set to the counter
and reload register. The value written into the timer Bi register when the counting is in progress is
set only to the reload register. In this case, the reload register’s updated contents are transferred to
the counter when the next underflow occurs. The counter value is read out by reading out the timer
Bi register.
Note: When reading from or writing to the timer Bi register, perform it in a unit of 16 bits. For more
information about the value obtained by reading the timer Bi register, refer to “[Precautions
for timer mode]” and “[Precautions for event counter mode].”
(2)
Functions in pulse period/pulse width measurement mode
Countup in the counter is performed each time the count source is input. The reload register is used
to retain the pulse period or pulse width measurement result. When a valid edge is input to the TBjIN
pin, the counter value is transferred to the reload register. In this mode, the value obtained by
reading the timer Bj register is the reload register’s contents, so that the measurement result is
obtained.
Note: When reading from the timer Bj register, perform it in a unit of 16 bits.
Timer Bi register
Timer B0 register
Timer B1 register
Timer B2 register
Low-order byte
Address 5016
Address 5216
Address 5416
High-order byte
Address 5116
Address 5316
Address 5516
Note : At reset, the contents of the timer Bi
register are undefined.
Table 9.2.1 Memory assignment of timer Bi registers