CHAPTER 7 8-BIT TIMER/EVENT COUNTER
User's Manual U11919EJ3V0UM00
111
7.4.2 Operation as external event counter
The external event counter counts the number of external clock pulses input to the TI0/P50/TO0 pin by using
timer counter 00 (TM00).
To operate the 8-bit timer/event counter as an external event counter, the following settings are required.
<1> Set P50 to input mode (PM50 = 1).
<2> Disable the operation of 8-bit timer counter 00 (TM00) (TCE00 (bit 7 of 8-bit timer mode control register 00
(TMC00)) = 0).
<3> Specify the rising or falling edge of TI0 (see Table 7-4).
<4> Set a count value in CR00.
<5> Enable the operation of TM00 (TCE00 = 1).
Each time the valid edge specified by the bit 1 or 2 (TCL001 or TCL000) of TMC00 is input, the value of 8-bit
timer counter 00 (TM00) is incremented.
When the count value of TM00 coincides with the value set to CR00, the value of TM00 is cleared to 0 and TM00
continues counting. At the same time, an interrupt request signal (INTTM0) is generated.
Figure 7-5 shows the timing of external event counter operation (with rising edge specified).
Cautions 1. Before rewriting CR00, stop the timer operation. If CR00 is rewritten while the timer
operation is enabled, the coincidence interrupt request signal may be generated
immediately.
2. If setting the count clock in TMC00 and enabling the operation of TM00 are performed at the
same time with an 8-bit memory manipulation instruction, the error one cycle after the timer
has been started may exceed one clock. To use the 8-bit timer/event counter as an external
event counter, therefore, perform the setting in the above sequence.
Figure 7-5. External Event Counter Operation Timing (with Rising Edge Specified)
TI0 Pin Input
TM00 Count Value
CR00
TCE00
INTTM0
00
01
02
03
04
05
N
-
1
N
00
01
02
03
N
Remark
N = 00H to FFH
www.DataSheet4U.com
Summary of Contents for UPD789026 Series
Page 2: ...User s Manual U11919EJ3V0UM00 2 MEMO www DataSheet4U com...
Page 8: ...User s Manual U11919EJ3V0UM00 8 MEMO www DataSheet4U com...
Page 12: ...User s Manual U11919EJ3V0UM00 12 MEMO www DataSheet4U com...
Page 22: ...User s Manual U11919EJ3V0UM00 22 MEMO www DataSheet4U com...
Page 32: ...User s Manual U11919EJ3V0UM00 32 MEMO www DataSheet4U com...
Page 84: ...User s Manual U11919EJ3V0UM00 84 MEMO www DataSheet4U com...
Page 92: ...User s Manual U11919EJ3V0UM00 92 MEMO www DataSheet4U com...
Page 104: ...User s Manual U11919EJ3V0UM00 104 MEMO www DataSheet4U com...
Page 166: ...User s Manual U11919EJ3V0UM00 166 MEMO www DataSheet4U com...
Page 178: ...User s Manual U11919EJ3V0UM00 178 MEMO www DataSheet4U com...
Page 184: ...User s Manual U11919EJ3V0UM00 184 MEMO www DataSheet4U com...
Page 204: ...User s Manual U11919EJ3V0UM00 204 MEMO www DataSheet4U com...
Page 206: ...User s Manual U11919EJ3V0UM00 206 MEMO www DataSheet4U com...
Page 212: ...User s Manual U11919EJ3V0UM00 212 MEMO www DataSheet4U com...