External Event Counter Operation - NEC mPD780344 Series User Manual

8-bit single-chip microcontrollers
Table of Contents

Advertisement

6.5.4 External event counter operation

The external event counter counts the number of external clock pulses to be input to the TI00/P35 pin with 16-
bit timer counter 0 (TM0).
TM0 is incremented each time the valid edge specified with prescaler mode register 0 (PRM0) is input.
When the TM0 counted value matches the 16-bit timer capture/compare register 00 (CR00) value, TM0 is cleared
to 0 and the interrupt request signal (INTTM00) is generated.
Input any value except 0000H to CR00. (Count operation with a pulse cannot be carried out.)
The rising edge, the falling edge, or both edges can be selected with bits 4 and 5 (ES00 and ES01) of prescaler
mode register 0 (PRM0).
Because capture operation is carried out only after the valid edge of the TI00/P35 pin is detected twice by sampling
with the internal clock (f
/2
X
Figure 6-23. Control Register Settings in External Event Counter Mode
TMC0
0
0
0
CRC0
0
0
0
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with the external event counter.
See Figure 6-3.
148
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 0
3
), noise with a short pulse width can be eliminated.
(a) 16-bit timer mode control register 0 (TMC0)
TMC03
TMC02
OVF0
0
1
1
0
(b) Capture/compare control register 0 (CRC0)
CRC02
CRC01
CRC00
0
0
0/1
0/1
User's Manual U15798EJ2V0UD
0
Clears and starts on match between TM0 and CR00.
0
CR00 used as compare register

Advertisement

Table of Contents
loading

Table of Contents