Operation As External Event Counter - NEC mPD789026 Subseries User Manual

8-bit single-chip
Table of Contents

Advertisement

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.
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
Remark
N = 00H to FFH
CHAPTER 7 8-BIT TIMER/EVENT COUNTER
00
01
02
03
04
User's Manual U11919EJ3V0UM00
If CR00 is rewritten while the timer
05
N - 1
N
00
N
01
02
03
111

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mpd789022Mpd789024Mpd789025Mpd789026Mpd78f9026a

Table of Contents