External Event Counter Operation - NEC 78K0 User Manual

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0:
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 15 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.
Figure 6-26. Control Register Settings in External Event Counter Mode
7
6
TMC00
0
0
7
6
CRC00
0
0
148
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
) and an operation is only performed when a valid level of the
X
(with Rising Edge Specified) (1/2)
(a) 16-bit timer mode control register 00 (TMC00)
5
4
TMC003
TMC002
TMC001
0
0
1
1
0/1
(b) Capture/compare control register 00 (CRC00)
5
4
3
CRC002
CRC001
0
0
0
0/1
0/1
User's Manual U16227EJ2V0UD
OVF00
0
Clears and starts on match between TM00 and CR000.
CRC000
0
CR000 used as compare register

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

78kc1

Table of Contents