|
M38002M4 Datasheet, PDF (65/173 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER | |||
|
◁ |
APPLICATION
2.2 Timer
(4) Timer application example 3 : Measurement of frequency
Outline : The following two values are compared for judging if the frequency is within a certain range.
⢠A value counted a pulse which is input to P55/CNTR1 pin by a timer.
⢠A referance value
Specifications : ⢠The pulse is input to the P55/CNTR1 pin and counted by the Timer Y.
⢠A count value is read out at the interval of about 2 ms (Timer 1 interrupt interval
: 244 µs ! 8). When the count value is 28 to 40, it is regarded the input pulse
as a valid.
⢠Because the timer is a down-counter, the count value is compared with 227 to 215V .
V 227 to 215 = 255 (initialized value of counter) â 28 to 40 (the number of valid
value).
Figure 2.2.17 shows a method for judging if input pulse exists, and Figure 2.2.18 shows a setting of
related registers.
Input pulse
â¢â¢â¢â¢
â¢â¢â¢â¢
â¢â¢â¢â¢
71.4 µs or more
(14 kHz or less)
Invalid
71.4 µs
(14 kHz)
Valid
50 µs(20 kHz)
50 µs or less
(20 kHz or more)
Invalid
2 ms
71.4 µs
= 28 counts
2 ms
50 µs
= 40 counts
Fig 2.2.17 A method for judging if input pulse exists
3800 GROUP USERâS MANUAL
2-17
|
▷ |