English
Language : 

UPD78F0411GA-GAM-AX Datasheet, PDF (202/564 Pages) Renesas Technology Corp – Old Company Name in Catalogs and Other Documents
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
(2) Measuring the pulse width by using one input signal of the TI000 pin (free-running mode)
Set the free-running timer mode (TMC003 and TMC002 = 01). The count value of TM00 is captured to CR000 in
the phase reverse to the valid edge detected on the TI000 pin. When the valid edge of the TI000 pin is detected,
the count value of TM00 is captured to CR010.
By this measurement method, values are stored in separate capture registers when a width from one edge to
another is measured. Therefore, the capture values do not have to be saved. By subtracting the value of one
capture register from that of another, a high-level width, low-level width, and cycle are calculated.
If an overflow occurs, the value becomes negative if one captured value is simply subtracted from another and,
therefore, a borrow occurs (bit 0 (CY) of the program status word (PSW) is set to 1). If this happens, ignore CY
and take the calculated value as the pulse width. In addition, clear bit 0 (OVF00) of 16-bit timer mode control
register 00 (TMC00) to 0.
Figure 6-50. Timing Example of Pulse Width Measurement (2)
• TMC00 = 04H, PRM00 = 10H, CRC00 = 07H
FFFFH
TM00 register
0000H
Operable bits 00
(TMC003, TMC002)
M
A
01
Capture trigger input
(TI000)
Capture register
(CR000)
0000H
A
Capture register
(CR010)
0000H
Capture interrupt
(INTTM010)
Overflow flag
(OVF00)
Capture trigger input
(TI010) L
Compare match interrupt
(INTTM000) L
N
S
B
C
D
B
M
N
C
S
0 write clear 0 write clear
P
Q
E
D
E
P
Q
0 write clear 0 write clear
200
User’s Manual U18698EJ1V0UD