External Event Counter Operation - NEC 78K0/KB1+ Preliminary User's Manual

8-bit single-chip microcontrollers
Table of Contents

Advertisement

6.4.4 External event counter operation

Setting
The basic operation setting procedure is as follows.
<1> Set the CRC00 register (see Figure 6-26 for the set value).
<2> Set the count clock by using the PRM00 register.
<3> Set any value to the CR000 register (0000H cannot be set).
<4> Set the TMC00 register to start the operation (see Figure 6-26 for the set value).
Remarks 1. For the setting of the TI000 pin, see 6.3 (5) Port mode register 0 (PM0).
2. For how to enable the INTTM000 interrupt, see CHAPTER 14 INTERRUPT FUNCTIONS.
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).
Sampling is performed using the internal clock (f
TI000 pin is detected twice, thus eliminating noise with a short pulse width.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
) and an operation is only performed when the valid level of the
X
Preliminary User's Manual U16846EJ1V0UD
129

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ypd78f0101hYpd78f0102hYpd78f0103h

Table of Contents