
CHAPTER 8 16-BIT TIMER/EVENT COUNTER 0
User’s Manual U16890EJ1V0UD
318
(1) Pulse width measurement with free-running timer operation and one capture register
If the edge specified by the PRM0n register is input to the TI0n0 pin when 16-bit timer/event counter 0n is
operated in the free-running timer mode (refer to
Figure 8-9
), the value of the TM0n register is loaded to the
CR0n1 register and an external interrupt request signal (INTTM0n1) is generated.
The valid edge is specified by the PRM0n.ESn00 and PRM0n.ESn01 bits. The rising edge, falling edge, or
both the rising and falling edges can be selected.
The valid edge is detected through sampling at a count clock cycle selected with the PRM0n register, and the
capture operation is not performed until the valid edge is detected twice. As a result, noise with a short pulse
width can be eliminated.
Remark
n = 0 to 3
Figure 8-9. Control Register Settings for Pulse Width Measurement
with Free-Running Timer Operation and One Capture Register
(When TI0n0 Pin and CR0n1 Registers Are Used)
(a) 16-bit timer mode control register 0n (TMC0n)
0
0
0
0
0
TMC0n3
TMC0n
TMC0n2
TMC0n1
OVF0n
Free-running timer mode
1
0
0
(b) Capture/compare control register 0n (CRC0n)
0
0
0
0
0
CRC0n
CRC0n2
CRC0n1
CRC0n0
CR0n0 used as compare register
CR0n1 used as capture register
1
0/1
0
(c) Prescaler mode register 0n (PRM0n)
0/1
0/1
1
1
0
PRM0n
Selects count clock
(Setting to 11 is prohibited.)
Specifies both edges for
pulse detection
Setting invalid
(Setting to 10 is prohibited.)
0
0/1
0/1
2
PRM0n1
PRM0n0
ESn01
ESn10
ESn11
ESn00
3
Remarks 1.
0/1: When these bits are reset to 0 or set to 1, other functions can be used together with the
pulse width measurement function. For details, refer to
8.3 (2) Capture/compare control
register 0n (CRC0n)
.
2.
n = 0 to 3