External Event Counter Operation - NEC 78K0/KD1 Series User Manual

8-bit single-chip microcontrollers
Table of Contents

Advertisement

6.4.4 External event counter operation

The external event counter counts the number of external clock pulses input to the TI000 pin using 16-bit timer
counter 00 (TM00).
TM00 is incremented each time the valid edge specified by prescaler mode register 00 (PRM00) is input.
When the TM00 count value matches the 16-bit timer capture/compare register 000 (CR000) value, TM00 is
cleared to 0 and the interrupt request signal (INTTM000) is generated.
Input a value other than 0000H to CR000 (a count operation with 1-bit pulse cannot be carried out).
Any of three edgesrising, falling, or both edgescan be selected using bits 4 and 5 (ES000 and ES001) of
prescaler mode register 00 (PRM00).
Because operation is carried out only after the valid edge is detected twice by sampling using the internal clock (f
noise with short pulse widths can be eliminated.
Figure 6-23. Control Register Settings in External Event Counter Mode
TMC00
0
0
CRC00
0
0
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with the external event counter.
For details, see Figures 6-2 and 6-3.
150
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
(a) 16-bit timer mode control register 00 (TMC00)
TMC003
TMC002
TMC001
0
0
1
1
0/1
(b) Capture/compare control register 00 (CRC00)
CRC002
CRC001
0
0
0
0/1
0/1
Preliminary User's Manual U16315EJ1V0UD
OVF00
0
Clears and starts on match between TM00 and CR000.
CRC000
0
CR000 used as compare register
),
X

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents