![](http://datasheet.mmic.net.cn/110000/M37721S1BFP_datasheet_3496256/M37721S1BFP_123.png)
TIMER A
7721 Group User’s Manual
8–4
8.2 Block description
8.2.1 Counter and reload register (timer Ai register)
Each of timer Ai counter and reload register consists of 16 bits.
Countdown in the counter is performed each time the count source is input. In the event counter mode,
it can also function as an up-counter.
The reload register is used to store the initial value of the counter. When a counter underflow or overflow
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 Ai register. Table 8.2.1
lists the memory assignment of the timer Ai register.
The value written into the timer Ai register while counting is not in progress is set to the counter and reload
register. The value written into the timer Ai register while 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 at the next
reload time. The value obtained when reading out the timer Ai register varies according to the operating
mode. Table 8.2.2 lists reading from and writing to the timer Ai register.
Table 8.2.2 Reading from and writing to timer Ai register
Write
<While counting>
Written only to reload register.
<While not counting>
Written to both of the counter
and reload register.
Operating mode
Timer mode
Event counter mode
One-shot pulse mode
Pulse width modulation (PWM) mode
Note: At reset, the contents of the timer Ai
register are undefined.
Notes 1: Also refer to “[Precautions for timer mode]” and “[Precautions for event counter mode].”
2: When reading from and writing to the timer Ai register, perform it in a unit of 16 bits.
Read
Counter value is read out.
(Note 1)
Undefined value is read out.
Table 8.2.1 Memory assignment of timer Ai register
Timer Ai register
High-order byte
Low-order byte
Timer A0 register
Address 4716
Address 4616
Timer A1 register
Address 4916
Address 4816
Timer A2 register
Address 4B16
Address 4A16
Timer A3 register
Address 4D16
Address 4C16
Timer A4 register
Address 4F16
Address 4E16