English
Language : 

M38203M4 Datasheet, PDF (160/344 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER
APPLICATION
2.3 Timer X and timer Y
sPulse width HL countinuously measurement mode
Figure 2.3.31 shows an example of setting registers for using the pulse width HL countinuously
measurement mode.
[Notes on use]
Notes 1: For using interrupt processing, set the following :
•Before setting Œ below, clear the interrupt enable bits (timer Y or CNTR1) and the
interrupt request bits (timer Y or CNTR1) to “0.”
•After setting  below, set the interrupt enable bits (timer Y or CNTR1) to “1”
(interrupts enabled).
2: Write values in the order of the timer Y (low-order) ant the timer Y (high-order).
ŒPort P5 direction register
b7
b0
0
P5D : Port P5 direction register [Address 0B16]
b5 : Bit corresponding to port P55
0 : Input mode
Setting of timer Y mode register
Select pulse width HL continuously measurement mode or others
b7
1 11
b0
TYM : Timer Y mode register [Address 2816]
b5, b4 : Timer Y operating mode bits
1 1 : Pulse width HL continuously measurement mode
b6 : CNTR1 active edge switch bit
Invalid in pulse width HL continuously measurement
mode
b7 : Timer Y stop control bit
1 : Count stop
: Nothing is allocated
ŽSet count value (low-order) to timer Y (low-order) (TYL) [Address 2216]
Set count value (high-order) to timer Y (high-order) (TYH) [Address 2316]
Set timer Y stop control bit of timer Y mode register to “0” to start counting
Fig. 2.3.31 Example of setting registers for using pulse width HL continuously measurement mode
2–74
3820 GROUP USER’S MANUAL