NEC mPD784225 Series User Manual page 165

16-/8-bit single-chip microcontrollers
Table of Contents

Advertisement

(2) Measurement of two pulse widths with free-running counter
The pulse widths of the two signals respectively input to the TI00/P35 and TI01/P36 pins can be measured when
16-bit timer counter 0 (TM0) is used as a free-running counter (refer to Figure 8-13).
When the edge specified by bits 4 and 5 (ES00 and ES01) of prescaler mode register 0 (PRM0) is input to the
TI00/P35 pin, the value of the TM0 is loaded to 16-bit capture/compare register 01 (CR01) and an external interrupt
request signal (INTTM01) is set.
When the edge specified by bits 6 and 7 (ES10 and ES11) is input to the TI01/P36 pin, the value of TM0 is loaded
to 16-bit capture/compare register 00 (CR00), and an external interrupt request signal (INTTM00) is set.
The rising, falling, or both rising and falling edges can be specified for the TI00/P35 and TI01/P36 pins.
The valid edge of TI00/P35 pin and TI01/P36 pin is detected through sampling at a count clock cycle selected
by prescaler mode register 0 (PRM0), and the capture operation is not performed until the valid level is detected
two times. Therefore, noise with a short pulse width can be rejected.
Figure 8-13. Control Register Settings for Measurement of Two Pulse Widths with Free-Running Counter
TMC0
0
0
CRC0
0
0
Remark 0/1:
When these bits are reset to 0 or set to 1, the other functions can be used along with the pulse
width measurement function. For details, refer to Figures 8-2 and 8-3.
CHAPTER 8 16-BIT TIMER/EVENT COUNTER
(a) 16-bit timer mode control register 0 (TMC0)
TMC03
TMC02
TMC01
0
0
0
1
0/1
(b) Capture/compare control register 0 (CRC0)
CRC02
CRC01
0
0
0
1
0
User's Manual U12697EJ3V0UM
OVF0
0
Free running mode
CRC00
1
CR00 as capture register
Captures valid edge of TI01/P36 pin to CR00.
CR01 as capture register
165

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mpd784225y seriesMpd784224Mpd784225Mpd78f4225Mpd784224yMpd784225y ... Show all

Table of Contents