External Event Counter Operation; Control Register Settings In External Event Counter Mode - NEC PD78056F User Manual

Pd78058f series; pd78058fy series 8-bit single-chip microcontrollers
Table of Contents

Advertisement

8.5.5 External event counter operation

The external event counter counts the number of external clock pulses to be input to the TI00/P00 pin with the
16-bit timer register (TM0).
TM0 is incremented each time the valid edge specified with the external interrupt mode register 0 (INTM0) is input.
When the TM0 counted value matches the 16-bit capture/compare register 00 (CR00) value, TM0 is cleared to
0 and the interrupt request signal (INTTM00) is generated.
Set a value for CR00 other than 0000H (1-pulse count operation is not possible).
The rising edge, the falling edge or both edges can be selected with bits 2 and 3 (ES10 and ES11) of INTM0.
Because operation is carried out only after the valid edge is detected twice by sampling at the interval selected
with the sampling clock select register (SCS), noise with short pulse widths can be removed.
Figure 8-26. Control Register Settings in External Event Counter Mode
TMC0
0
0
CRC0
0
0
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with the external event
counter. See the description of the respective control registers for details.
200
CHAPTER 8 16-BIT TIMER/EVENT COUNTER
(a) 16-bit timer mode control register (TMC0)
TMC03
TMC02
TMC01
0
0
1
1
0/1
(b) Capture/compare control register 0 (CRC0)
CRC02
CRC01
0
0
0
0/1
0/1
OVF0
0
Clear & start with match of TM0 and CR00
CRC00
0
CR00 set as compare register

Advertisement

Table of Contents
loading

Table of Contents