English
Language : 

UPD78F0411GA-GAM-AX Datasheet, PDF (233/564 Pages) Renesas Technology Corp – Old Company Name in Catalogs and Other Documents
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50, 51, AND 52
7.4.2 Operation as external event counter (TM52 only)
The external event counter counts the number of external clock pulses to be input to the TI52 pin by 8-bit timer
counter 52 (TM52).
TM52 is incremented each time the valid edge specified by timer clock selection register 52 (TCL52) is input.
Either the rising or falling edge can be selected.
When the TM52 count value matches the value of 8-bit timer compare register 52 (CR52), TM52 is cleared to 0
and an interrupt request signal (INTTM52) is generated.
Whenever the TM52 value matches the value of CR52, INTTM52 is generated.
Setting
<1> Set each register.
• Set the port mode register (PM34) to 1.
• TCL52: Select TI52 pin input edge.
TI52 pin falling edge → TCL52 = 00H
TI52 pin rising edge → TCL52 = 01H
• CR52: Compare value
• TMC52: Stop the count operation.
(TMC52 = 00000000B)
<2> When TCE52 = 1 is set, the number of pulses input from the TI52 pin is counted.
<3> When the values of TM52 and CR52 match, INTTM52 is generated (TM52 is cleared to 00H).
<4> After these settings, INTTM52 is generated each time the values of TM52 and CR52 match.
Remark For how to enable the INTTM52 signal interrupt, see CHAPTER 17 INTERRUPT FUNCTIONS.
Figure 7-15. External Event Counter Operation Timing (with Rising Edge Specified)
TI52
Count start
TM52 count value
00H 01H 02H 03H 04H 05H
CR52
INTTM52
N − 1 N 00H 01H 02H 03H
N
Remark 1. 8-bit timer/event counter 52 (TM52) can be used as a 24-bit timer/event counter, by connecting
it with 16-bit timer/event counter (TM00) in cascade. Also, input enable of TM52 can be
controlled via TMH2. For details, see 6.4.9 External 24-bit event counter operation.
2. N = 00H to FFH
User’s Manual U18698EJ1V0UD
231