Control Register Settings For Pulse Width Measurement By Means Of Restart - NEC PD78052 User Manual

Pd78054 series; pd78054y series 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 TI00/P00 pin is detected, the count value of the 16-bit timer register (TM0)
is taken into 16-bit capture/compare register 01 (CR01), and then the pulse width of the signal input to the
TI00/P00 pin is measured by clearing TM0 and restarting the count (see register settings in Figure 8-24).
The edge specification can be selected from two types, rising and falling edges by external interrupt mode
register 0 (INTM0) bits 2 and 3 (ES10 and ES11).
In a valid edge detection, the sampling is performed by a cycle selected by the sampling clock selection register
(SCS), and a capture operation is only performed when a valid level is detected twice, thus eliminating noise
with a short pulse width.
Caution If the valid edge of TI00/P00 is specified to be both rising and falling edge, the 16-bit capture/
compare register 00 (CR00) cannot perform the capture operation.
Figure 8-24. Control Register Settings for Pulse Width Measurement by Means of Restart
TMC0
0
0
CRC0
0
0
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width
measurement. See the description of the respective control registers for details.
Figure 8-25. Timing of Pulse Width Measurement Operation by
t
Count Clock
TM0 Count Value
0000
TI00 Pin Input
CR01 Captured Value
CR00 Captured Value
INTP0
CHAPTER 8 16-BIT TIMER/EVENT COUNTER
(a) 16-bit timer mode control register (TMC0)
TMC03
TMC02
TMC01
0
0
1
0
0/1
(b) Capture/compare control register 0 (CRC0)
CRC02
CRC01
0
0
0
1
1
Means of Restart (with Rising Edge Specified)
0001
D0
0000
D0
D1
t
OVF0
0
Clear & start with valid edge of TI00/P00 pin
CRC00
1
CR00 set as capture register
Captured in CR00 on invalid
edge of TI00/P00 Pin
CR01 set as capture register
0001
D1
D1
D2
t
D2
0000
0001
D2
203

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents