162
CHAPTER 8 16-BIT TIMER/EVENT COUNTER
(3) Capture/compare register 01 (CR01)
CR01 is a 16-bit register which has the functions of both a capture register and a compare register. Whether it is
used as a capture register or a compare register is set by bit 2 (CRC02) of capture/compare control register 0.
When CR01 is used as a compare register
The value set in the CR01 is constantly compared with the 16-
bit timer register (TM0) count value, and an interrupt request (INTTM01) is generated if they match.
When CR01 is used as a capture register
It is possible to select the valid edge of the TI00/TO0/P70 pin
as the capture trigger. The TI00/TO0/P70 valid edge is set by means of prescaler mode register 0 (PRM0).
CR01 is set with a 16-bit memory manipulation instruction.
After RESET input, the value of CR01 is undefined.
Caution
Set other than 0000H to CR01. This means 1-pulse count operation cannot be performed when
CR01 is used as the event counter. However, in the free-running mode and in the clear mode
using the valid edge of TI01, if 0000H is set to CR01, an interrupt request (INTTM01) is
generated following overflow (FFFFH).
8.4 Registers to Control 16-Bit Timer/Event Counter
The following five types of registers are used to control the 16-bit timer/event counter.
16-bit timer mode control register (TMC0)
Capture/compare control register (CRC0)
16-bit timer output control register 0 (TOC0)
Prescaler mode register 0 (PRM0)
Port mode register 7 (PM7)
(1) 16-bit timer mode control register (TMC0)
This register sets the 16-bit timer operating mode, the 16-bit timer register clear mode, and output timing, and
detects an overflow.
TMC0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets TMC0 value to 00H.
Caution
The 16-bit timer register starts operation at the moment a value other than 0, 0 (operation stop
mode) is set in TMC02 to TMC03, respectively. Set 0, 0 in TMC02 to TMC03 to stop the
operation.