English
Language : 

M38002M4 Datasheet, PDF (68/173 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER
APPLICATION
2.2 Timer
(5) Timer application example 4 : Measurement of pulse width of FG pulse generated by motor
Outline : The “H” level width of a pulse input to the P54/CNTR0 pin is counted by Timer X. An
underflow is detected by Timer X interrupt and an end of the input pulse “H” level is detected
by CNTR0 interrupt.
Specifications : • The “H” level width of a FG pulse input to the P54/CNTR0 pin is counted by Timer
X.
(Example : When the clock frequency is 4.19 MHz, the count source would be
3.8 µs that is obtained by dividing the clock frequency by 16.
Measurement can be made up to 250 ms in the range of FFFF16 to
000016.)
Figure 2.2.20 shows a connection of the timer and a setting of the division ratio, and Figure 2.2.21
shows a setting of related registers.
f(XIN) = 4.19 MHz
Fixed
1/16
Prescaler X
1/256
Timer X Timer X interrupt request bit
1/256
0 or 1
250 ms
0 : No interrupt request
1 : Interrupt request
Fig. 2.2.20 Connection of the timer and setting of the division ratio [Measurement of pulse width]
2-20
3800 GROUP USER’S MANUAL