(3) Pulse width measurement with free-running counter and two capture registers
When 16-bit timer counter 00 (TM00) is operated in free-running mode, it is possible to measure the pulse width
of the signal input to the TI000 pin.
When the edge specified by bits 4 and 5 (ES000 and ES001) of prescaler mode register 00 (PRM00) is input to
the TI000 pin, the value of TM00 is taken into 16-bit timer capture/compare register 010 (CR010) and an interrupt
request signal (INTTM010) is set.
Also, when the inverse edge to that of the capture operation is input into CR010, the value of TM00 is taken into
16-bit timer capture/compare register 000 (CR000).
Sampling is performed using the count clock cycle selected by prescaler mode register 00 (PRM00), and a
capture operation is only performed when a valid level of the TI000 pin is detected twice, thus eliminating noise
with a short pulse width.
Figure 6-22. Control Register Settings for Pulse Width Measurement with Free-Running Counter and
7
TMC00
0
7
CRC00
0
ES101
PRM00
0/1
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.
144
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Two Capture Registers (with Rising Edge Specified)
(a) 16-bit timer mode control register 00 (TMC00)
6
5
4
TMC003
TMC002
0
0
0
0
(b) Capture/compare control register 00 (CRC00)
6
5
4
3
CRC002
0
0
0
0
(c) Prescaler mode register 00 (PRM00)
ES100
ES001
ES000
3
0/1
0
1
0
Preliminary User's Manual U16962EJ1V0UD
TMC001
OVF00
1
0/1
0
Free-running mode
CRC001
CRC000
1
1
1
CR000 used as capture register
Captures to CR000 at inverse edge
to valid edge of TI000.
CR010 used as capture register
2
PRM001
PRM000
0
0/1
0/1
Selects count clock (setting "11" is prohibited).
Specifies rising edge for pulse width detection.
Setting invalid (setting "10" is prohibited.)