CHAPTER 7 8-BIT TIMERS 50, 60, AND 61
User’s Manual U15331EJ4V1UD
140
(2) Operation as external event counter with 8-bit resolution (timer 60 and timer 61 only)
The external event counter counts the number of external clock pulses input to the TMI6m pin by using 8-bit
timer counter 6m (TM6m).
To operate timer 6m as an external event counter, settings must be made in the following sequence.
<1> Disable operation of 8-bit timer counter 6m (TM6m) (TCE6m = 0).
<2> Disable timer output of TO6m (TOE6m0 = 0).
<3> When using timer 60, set P30 to input mode (PM30 = 1).
When using timer 61, set P32 to input mode (PM32 = 1).
<4> Select the external input clock for timer 6m (see Figures 7-7 and 7-9).
<5> Set the operation mode of timer 6m to 8-bit timer counter mode (see Figures 7-7 and 7-9).
<6> Set a count value in CR6m.
<7> Enable the operation of TM6m (TCE6m = 1).
Each time the valid edge is input, the value of TM6m is incremented.
When the count value of TM6m matches the value set in CR6m, TM6m is cleared to 00H and continues
counting. At the same time, an interrupt request signal (INTTM6m) is generated.
Figure 7-17 shows the timing of the external event counter operation.
Caution Be sure to stop the timer operation before overwriting the count clock with different data.
Remark m = 0, 1
Figure 7-17. Timing of Operation of External Event Counter with 8-Bit Resolution
TMI6m pin input
TM6m count value
CR6m
TCE6m
INTTM6m
00H 01H 02H 03H 04H 05H N − 1 N 00H 01H 02H 03H
N
Remark N = 00H to FFH