NEC 78K0/KD1 Series User Manual page 145

8-bit single-chip microcontrollers
Table of Contents

Advertisement

(2) Measurement of two pulse widths with free-running counter
When 16-bit timer counter 00 (TM00) is operated in free-running mode (see Figure 6-16), it is possible to
simultaneously measure the pulse widths of the two signals input to the TI000 pin and the TI010 pin.
When the edge specified by bits 4 and 5 (ES000 and ES001) of prescaler mode register 00 (PRM00) is input to
the TI000 pin, the value of TM00 is taken into 16-bit timer capture/compare register 010 (CR010) and an interrupt
request signal (INTTM010) is set.
Also, when the edge specified by bits 6 and 7 (ES100 and ES101) of PRM00 is input to the TI010 pin, the value
of TM00 is taken into 16-bit timer capture/compare register 000 (CR000) and an interrupt request signal
(INTTM000) is set.
Any of three edgesrising, falling, or both edgescan be selected as the valid edge of the TI000 pin and the
TI010 pin, specified using bits 4 and 5 (ES000 and ES001) and bits 6 and 7 (ES100 and ES101) of PRM00,
respectively.
For valid edge detection of the TI000 and TI010 pins, sampling is performed at the interval selected by prescaler
mode register 00 (PRM00), and a capture operation is only performed when a valid level is detected twice, thus
eliminating noise with a short pulse width.
Figure 6-16. Control Register Settings for Measurement of Two Pulse Widths with Free-Running Counter
TMC00
CRC00
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement.
For details, see Figure 6-2.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
(a) 16-bit timer mode control register 00 (TMC00)
TMC003
0
0
0
0
0
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
Preliminary User's Manual U16315EJ1V0UD
TMC002
TMC001
OVF00
1
0/1
0
Free-running mode
CRC002
CRC001
CRC000
1
0
1
CR000 used as capture register
Captures valid edge of TI010 pin to CR000
CR010 used as capture register
145

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents