
CHAPTER 7 16-BIT TIMER/EVENT COUNTERS 00 TO 05
User
’
s Manual U15862EJ3V0UD
305
(2) 16-bit timer capture/compare register 0n0 (CR0n0)
The CR0n0 register is a 16-bit register that combines capture register and compare register functions.
Bit 0 (CRC0n0) of the capture/compare control register (CRC0n) is used to set whether to use the CR0n0
register as a capture register or as a compare register.
(a) When using the CR0n0 register as a compare register
The value set to the CR0n0 register and the count value set to the TM0n register are always compared
and when these values match, an interrupt request signal (INTTM0n0) is generated. When the TM0n
register is set to operate as an interval timer, CR0n0 can be used as a register for holding the interval
time.
(b) When using the CR0n0 register as a capture register
The TM0n register count value is captured to the CR0n0 register by inputting a capture trigger.
The valid edge of the TI0n0 pin or TI0n1 pin can be selected as the capture trigger. The valid edge of the
TI0n0 pin or TI0n1 pin is set with prescaler mode register 0n (PRM0n).
Table 7-2 shows the settings when the valid edge of the TI0n0 pin is specified as the capture trigger, and
Table 7-3 shows the settings when the valid edge of the TI0n1 is specified as the capture trigger.
Table 7-2. Valid Edge of TI0n0 Pin and Capture Trigger of CR0n0 Register
ESn01
ESn00
Valid Edge of TI0n0 Pin
Capture Trigger of CR0n0 Register
0
0
Falling edge
Rising edge
0
1
Rising edge
Falling edge
1
0
Setting prohibited
Setting prohibited
1
1
Both rising and falling edges
No capture operation
Remark
n = 0 to 5
Table 7-3. Valid Edge of TI0n1 Pin and Capture Trigger of CR0n0 Register
ESn11
ESn10
Valid Edge of TI0n1 Pin
Capture Trigger of CR0n0 Register
0
0
Falling edge
Falling edge
0
1
Rising edge
Rising edge
1
0
Setting prohibited
Setting prohibited
1
1
Both rising and falling edges
Both rising and falling edges
Remark
n = 0 to 5
The CR0n0 register is set by a 16-bit memory manipulation instruction.
RESET input sets this register to 0000H.