upd70f3402 Renesas Electronics Corporation., upd70f3402 Datasheet - Page 349

no-image

upd70f3402

Manufacturer Part Number
upd70f3402
Description
32-/16-bit Single-chip Microcontroller With Can Interface
Manufacturer
Renesas Electronics Corporation.
Datasheet
8.5.8 Pulse width measurement mode (TQnMD2 to TQnMD0 = 110)
In the pulse width measurement mode, free-running counting is performed. The value of the 16-bit
counter is captured to capture register m (TQnCCRm) when both the rising and falling edges of the
TIQnm pin are detected, and the 16-bit counter is cleared to 0000H. In this way, the external input pulse
width can be measured.
To measure a long pulse width that exceeds the overflow of the 16-bit counter, use the overflow flag for
detection. A pulse width that causes overflow to occur twice or more cannot be measured. Adjust the
operating frequency of the 16-bit counter.
Caution:
Caution:
Remark:
Figure 8-30: Flowchart of Basic Operation in Pulse Width Measurement Mode
In the pulse width measurement mode, select the internal clock (TQnEEE of
TQnCTL1 register = 0) as a count clock.
An external pulse can be input from any of TIQn0 to TIQn3 but only one of them can
be used. Specify that both the rising and falling edges are detected. Specify that the
input edge of an external pulse input that is not used is not detected.
n = 0 to 1, m = 0 to 3
Chapter 8 16-Bit Timer/Event Counter Q
User’s Manual U16702EE3V2UD00
• Select clock.
• Set pulse width measurement mode.
• Set compare register.
(TQnCTL0: TQnCKS2 to TQnCKS0)
(TQnCTL1: TQnMD2 to TQnMD0 = 110)
(TQnOPT0: TQnCCS3 to TQnCCS0)
Input falling edge of pulse to TIQnm.
Enable timer operation (TQnCE = 1).
Input rising edge of pulse to TIQnm.
Set edge detection of TIQnm
Clear and start 16-bit counter.
Clear and start 16-bit counter.
Capture value to TQnCCRm.
Capture value to TQnCCRm.
(TQnIS3 to TQnIS0)
Initial setting
START
Note
.
349

Related parts for upd70f3402