NEC 78K0/KD1 Series User Manual page 149

8-bit single-chip microcontrollers
Table of Contents

Advertisement

(4) Pulse width measurement by means of restart
When input of a valid edge to the TI000 pin is detected, the count value of 16-bit timer counter 00 (TM00) is taken
into 16-bit timer capture/compare register 010 (CR010), and then the pulse width of the signal input to the TI000
pin is measured by clearing TM00 and restarting the count operation (see Figure 6-21).
Either of two edgesrising or fallingcan be selected using bits 4 and 5 (ES000 and ES001) of prescaler mode
register 00 (PRM00).
In valid edge detection, sampling is performed using the count clock cycle 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-21. Control Register Settings for Pulse Width Measurement by Means of Restart
TMC00
0
CRC00
0
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement.
For details, see Figure 6-2.
Figure 6-22. Timing of Pulse Width Measurement Operation by Means of Restart
Count clock
TM00 count value
TI000 pin input
CR010 capture value
CR000 capture value
INTTM010
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
(a) 16-bit timer mode control register 00 (TMC00)
TMC003
TMC002
0
0
0
1
0
(b) Capture/compare control register 00 (CRC00)
CRC002
0
0
0
0
1
(with Rising Edge Specified)
t
0000H
0001H
Preliminary User's Manual U16315EJ1V0UD
TMC001
OVF00
0/1
0
Clears and starts at valid edge of TI000 pin.
CRC001
CRC000
1
1
CR000 used as capture register
Captures to CR000 at inverse edge to valid edge of TI000.
CR010 used as capture register
D0
0000H 0001H
D1
D0
D1
D1 × t
D2 × t
D2
0000H
0001H
D2
149

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents