2.3 Timer X and timer Y
APPLICATION
2–55
3820 GROUP USER’S MANUAL
Fig. 2.3.15 Structure of timer Y latch
(4) Timer Y latch and timer Y counter (TYL and TYH)
The timer Y latch (referred as “the Y latch”) and the timer Y counter (referred as “the Y counter”)
consist of 16 bits in a combination of high-order (address 0023
16
) and low-order (address 0022
16
).
The Y latch and Y counter are allocated at the same address. To access the Y latch and the Y
counter, access both the timer Y (low-order) and the timer Y (high-order).
I
Read
When the timer Y (high-order and low-order) are read out, the value of the Y counter (count value)
are read out. Read both registers in the order of the timer Y (high-order) and the timer Y (low-order).
Do not write any value to the timer Y (high-order and low-order) before the timer Y (low-order) has
been read out. In this case, timer Y will not operate normally.
I
Write
When a value is written to the timer Y (low-order and high-order), the value is set in the Y latch and
the Y counter at the same time. Write the values to both registers in the order of the timer Y (low-
order) and the timer Y (high-order).
Do not read the timer Y (low-order and high-order) before the timer Y (high-order) has been written.
In this case, timer Y will not operate normally.
G
Timer Y latch
The Y latch is a register which holds the value to be transferred (reloaded) automatically to the Y
latch as the initial value of the Y counter at the Y counter underflow. Figure 2.3.15 shows the
structure of the timer Y latch.
Reload is performed at the following :
At the Y counter underflow
At the edge of the input pulse from the P5
5
/CNTR
1
pin
(period measurement mode/pulse width HL coutinuously measurement mode)
The contents of the Y latch cannot be read out.
Note :
Write both registers in the order of TYL and TYH.
b7b6 b5b4b3 b2b1b0
Timer Y (high-order, low-order) (TYH, TYL) [Address 23
16
, 22
16
]
B
0
to
7
Functions
At reset R W
1
Timer Y (high-order, low-order)
Set “0000
16
to FFFF
16
” as timer Y count value.
Write high-order byte of setting value to TYH,
and low-order byte to TYL, respectively.
The values of TYH and TYL are set to the
respective Y latches and transferred auto-
matically to the respective Y counters at the
Y counter underflow.
G
Timer Y latch
×