109
CHAPTER 6 8-BIT TIMER/EVENT COUNTERS 50 TO 53
User’s Manual U15104EJ2V0UD
6.4.2 Operation as external event counter (timers 50 to 52)
The external event counter counts the number of clock pulses input from an external source to the TI5n pin using
8-bit timer counter 5n (TM5n).
Each time the valid edge specified by timer clock select register 5n (TCL5n) has been input to TI5n, the value of
TM5n is incremented. As the valid edge, either the rising or falling edge can be selected.
When the count value of TM5n matches the value of 8-bit compare register 5n (CR5n), TM5n is cleared to 0, and
an interrupt request signal (INTTM5n) is generated.
After that, each time the value of TM5n matches the value of CR5n, INTTM5n is generated.
[Setting]
<1> Set each register.
•
TCL5n:
Select the valid edge of TI5n input.
•
CR5n:
Compare value
•
TMC5n: Select a mode in which TM5n is cleared and started on match between TM5n and CR5n.
<2> The count operation is started when TEC5n is set to 1.
<3> INTTM5n is generated if the values of TM5n and CR5n match (TM5n is cleared to 00H).
<4> After that, INTTM5n is generated each time the value of TM5n matches the value of CR5n. To stop the count
operation, clear TCE5n to 0.
Remark
n = 0 to 2
Figure 6-10. Operation Timing of External Event Counter (with Rising Edge Specified)
TI5n
TM5n count value
CR5n
INTTM5n
00
01
02
03
04
05
N – 1
N
00
01
02
03
N
n = 0 to 2
Содержание mPD178053
Страница 2: ...2 User s Manual U15104EJ2V0UD MEMO ...