1-64
1.12 Timer X and Timer Y
HARDWARE
7480 Group and 7481 Group User's Manual
1.12.3 Basic Operations of Timer X and Timer Y
Basic operations of timer X and timer Y are described below.
For details, refer to (1) Operations of each mode.
Count Sources
Timer X or timer Y can select the following count sources with the timer X or Y count source selection bits
of the timer X or Y mode register:
f(XIN)/2
f(XIN)/8
f(XIN)/16
CNTR0 or CNTR1 pin input (in event count mode only).
Note: In the event count mode, the inverted signal of input to a CNTR pin is used as the count source when
a CNTR edge selection bit of the edge polarity selection register is ‘1’.
Writes to and Reads from Timers
Write to and read from each timer two bytes together in the following order:
Write: low-order byte high-order byte
Read: high-order byte low-order byte
Note: When a read from and a write into the same timer are executed during an interrupt service routine
etc., the normal operation cannot be performed.
Writes to timers
When ‘TL (000016 through FFFF16)’ is written to a timer, the following different operations are
performed depending on the state of the timer X or Y write control bit of the timer X or Y mode
register:
In the ‘0’ state of the timer X or Y write control bit, the ‘TL’ is set in both the timer latch and the
timer.
Notes 1: A write to an operating timer causes the contents of the timer to be affected, so that the
time from the last underflow until the next underflow is undefined.
2: A write to the low-order byte of an operating timer allows the timer to continue counting
down until the next write to the high-order byte.
In the ‘1’ state of the timer X or Y write control bit, the ‘TL’ is set in the timer latch only.
Notes 1: A write to a stopped timer causes the contents of the timer not to be affected and allows
the timer to count down from the value prior to the write. Therefore, the time from the start
of count down until the first underflow is undefined.
2: If a write and an underflow occur at approximately the same time in an operating timer, the
reloaded value may be undefined.
Reads from timers
The contents of a timer can be read by a read operation; however, the contents of the timer latch
(measured value) are read in the pulse period measurement mode or the pulse width measurement
mode.
Note: When the high-order byte of an operating timer is read, the low-order byte is set in the latch
for reading. Therefore, the read value of the low-order byte retains the value at the time the
high-order byte is being read.