![](http://datasheet.mmic.net.cn/230000/7751_datasheet_15568130/7751_85.png)
T IME R A
7751 Group User’s Manual
5–4
5.2 Block description
5.2.1 Counter and reload register (timer Ai register)
Each of timer Ai counter and reload register consists of 16 bits.
The counter down-counts 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 the counter underflows or
overflows, the reload register’s contents are reloaded into the counter.
Values are set to the counter and reload register by writing a value to the timer Ai register. Table 5.2.1
lists the memory assignment of the timer Ai register.
The value written into the timer Ai register when counting is not in progress is set to the counter and reload
register. The value written into the timer Ai register when counting is in progress is set to only the reload
register. In this case, the reload register’s updated contents are transferred to the counter at the next
reload time. The value got when reading out the timer Ai register varies according to the operating mode.
Table 5.2.2 lists reading and writing from and to the timer Ai register.
Table 5.2.2 Reading and writing from and to timer Ai register
Write
<During counting>
Written to only reload register.
<When not counting>
Written to both counter and
reload register.
Operating mode
Timer mode
Event counter mode
One-shot pulse mode
Pulse width modulation (PWM) mode
Note:
When reset, the contents of the timer Ai
register are undefined.
Notes 1:
Also refer to
“[Precautions when operating in timer mode]”
and
“[Precautions when oper-
ating in event counter mode].”
2:
When reading and writing to/from the timer Ai register, perform them in a unit of 16 bits.
Read
Counter value is read out.
(
Note 1
)
Undefined value is read out.
Table 5.2.1 Memory assignment of timer Ai register
Timer Ai register
High-order byte
Timer A0 register
Address 47
16
Timer A1 register
Address 49
16
Timer A2 register
Address 4B
16
Timer A3 register
Address 4D
16
Timer A4 register
Address 4F
16
Low-order byte
Address 46
16
Address 48
16
Address 4A
16
Address 4C
16
Address 4E
16