
121
CHAPTER 6
16-BIT TIMER/EVENT COUNTER 0
User’s Manual U12790EJ2V0UD
6.2 Configuration of 16-Bit Timer/Event Counter 0
16-bit timer/event counter 0 consists of the following hardware.
Table 6-1. Configuration of 16-Bit Timer/Event Counter 0
Item
Configuration
Timer counter
16-bit timer counter 0 (TM0)
Register
16-bit capture/compare registers 00 and 01 (CR00 and CR01)
Timer input
TI00, TI01
Timer output
TO0
Control registers
 16-bit timer mode control register 0 (TMC0)
 Capture/compare control register 0 (CRC0)
 16-bit timer output control register 0 (TOC0)
 Prescaler mode register 0 (PRM0)
 Port mode register 3 (PM3)
 Port 3 (P3)
(1) 16-bit timer counter 0 (TM0)
TM0 is a 16-bit read-only register that counts count pulses.
The count value is incremented at the rising edge of the count clock. If the count value is read while the register
is operating, input of the count clock is temporarily stopped, and the count value at that point is read.
The count value is reset to 0000H in the following cases.
<1> When the RESET signal is input
<2> When TMC03 and TMC02 are cleared.
<3> When the valid TI00 edge is input in the clear & start mode
<4> When TM0 and CR00 match in the clear & start mode
<5> When OSPT is set or the valid TI00 edge is input in the one-shot pulse output mode
(2) 16-bit capture/compare register 00 (CR00)
CR00 is a 16-bit register with both the functions of a capture register and a compare register. Whether this
register is used as a capture register or a compare register is specified by bit 0 (CRC00) of capture/compare
control register 0.
When CR00 is used as compare register
The value set to CR00 is always compared with the count value of 16-bit timer counter 0 (TM0). When
the two values match, an interrupt request (INTTM00) is generated. When TM0 is used as an interval timer,
CR00 is also used to hold the interval time.
When CR00 is used as capture register
The valid edge of the TI00/P32 pin or the TI01/P33 pin can be selected as the capture trigger. The valid
edge of TI00 and TI01 is specified by prescaler mode register 0 (PRM0) (Refer to Table 6-2).