English
Language : 

M38203M4 Datasheet, PDF (169/344 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER
APPLICATION
2.3 Timer X and timer Y
sReal time port function
qAfter reset release, the port P6 direction register is set for the input mode, so the pins P60 and P61
function as ordinary I/O ports. For the pin to be used as RTP, be sure to set the corresponding bits
of the port P6 direction register for the output mode.
qFor a pin used as RTP, do not change this port for the input mode during real time port operation.
qChange RTP output data as required, for example, by using a timer X interrupt.
(2) Timer Y
sCommon to all modes
qWhen reading or writing for timer Y, be sure to execute for both the timer Y (high-order) and the
timer Y (low-order). When reading a value from the timer Y, read it in the order of the timer Y (high-
order) and the timer Y (low-order). When writing a value to the timer Y, execute in the order of the
timer Y (low-order) and the timer Y (high-order). If the following operations are performed for the
timer Y, abnormal operation will occur.
•Write operation before execution of timer Y (low-order) reading
•Read operation before execution of timer Y (high-order) writing
sPeriod measurement mode
qIn the period measurement mode, set the bit 5 (corresponding to the P55/CNTR1) of the port P5
direction register (address 000B16) to “0” (input mode).
qSetting the CNTR1 active edge switch bit effects on the active edge of an interrupt. Consequently,
the CNTR1 interrupt request may be caused by setting the CNTR1 active edge switch bit.
As a countermeasure, switch the active edge after disabling the CNTR1 interrupt, then set the
CNTR1 interrupt request bit to “0.”
qThe maximum input frequency in the period measurement mode is:
4 MHz (250 ns) .................................................. at VCC = 4.0 V to 5.5 V
(2 ! VCC) – 4 MHz
( 500 ns) .......... at VCC = 2.5 V to 4.0 V
VCC – 2
The minimum “H” pulse width is:
105 ns .................................................................. at VCC = 4.0 V to 5.5 V
( 250 – 20 ns) ........................................... at VCC = 2.5 V to 4.0 V
VCC – 2
The minimum “L” pulse is:
105 ns .................................................................. at VCC = 4.0 V to 5.5 V
( 250 – 20 ns) ........................................... at VCC = 2.5 V to 4.0 V
VCC – 2
sEvent counter mode
qIn the event counter mode, set the bit 5 (corresponding to the P55/CNTR1) of the port P5 direction
register (address 000B16) to “0” (input mode).
qSetting the CNTR1 active edge switch bit, the active edge of an interrupt is also affected. Conse-
quently, a CNTR1 interrupt request may be caused by setting the CNTR1 active edge switch bit.
qThe maximum input frequency in the event counter mode is:
4 MHz (250 ns) .................................................. at VCC = 4.0 V to 5.5 V
(2 ! VCC) – 4 MHz
( 500 ns) .......... at VCC = 2.5 V to 4.0 V
VCC – 2
The minimum “H” pulse width is:
105 ns .................................................................. at VCC = 4.0 V to 5.5 V
( 250
VCC – 2
– 20 ns) ........................................... at VCC = 2.5 V to 4.0 V
3820 GROUP USER’S MANUAL
2–83