English
Language : 

M38203M4 Datasheet, PDF (134/344 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER
APPLICATION
2.3 Timer X and timer Y
(4) Pulse width HL continuously measurement mode
In the pulse width HL continuously measurement mode, the width (“H” and “L” level) of pulses input
from the P55/CNTR1 pin are continuously measured.
With the exception that reload and an interrupt request occur at both edges of pulses input from the
P55/CNTR1 pin, the operation in the pulse width HL continuously measurement mode is the same as
that in the period measurement mode.
The pulse width HL continuously measurement mode of operation is described below.
xStart of count operation
Immediately after reset release, the timer Y stop control bit is in the “0” state. For this reason, the
count operation is automatically started after reset release.
The value of the Y counter is decremented by 1 each time a count source is input.
The count source is f(XIN)/16 (low-speed mode ; f(XCIN)/16).
Reload operation
At both edges of the pulse input from the P55/CNTR1 pin, the value of the timer Y is transferred
(reloaded) to the Y counter. The count value immediately before reload is held until it is read out
once after reload.
The value of the Y latch is also reloaded at the Y counter underflow.
ŽPulse width measurement
The difference between the count value at an active edge input and that immediately before reload
is a measured pulse width.
When reading a value from the timer Y, read both registers in order of the timer Y (high–order) and
the timer Y (low–order).
Interrupt operation
sEdge of input pulse
At both edges of pulses input from the P55/CNTR1 pin, an interrupt request occurs. At the same
time, the CNTR1 interrupt request bit is set to “1.” The occurrence of an interrupt is controlled by
the CNTR1 interrupt enable bit.
sCounter underflow
An interrupt request occurs at the Y counter underflow. At the same time, the timer Y interrupt
request bit is set to “1.”
The occurrence of an interrupt is controlled by the timer Y interrupt enable bit.
Figure 2.3.9 shows a pulse width HL continuously measurement mode operation example.
2–48
3820 GROUP USER’S MANUAL