English
Language : 

UPD784938 Datasheet, PDF (310/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 11 TIMER/EVENT COUNTER 2
(1) Timer counter 2 (TM2/TM2W)
TM2/TM2W is a timer counter that counts up the count clock specified by the high-order 4 bits of prescaler mode register
1 (PRM1). An internal clock or external clock can be selected as the count clock.
The count operation can be stopped or enabled by means of timer control register 1 (TMC1). The timer counter can
select to operate in an 8-bit (TM2) or 16-bit (TM2W) mode. TM2/TM2W can be read only with an 8/16-bit manipulation
instruction.
When RESET is input, TM2/TM2W is cleared to 00H and the count is stopped.
(2) Compare register (CR20/CR20W)
CR20/CR20W is an 8/16-bit register that holds the value that determines the interval timer operation cycle.
If the contents of the CR20/CR20W register match the contents of TM2/TM2W, an interrupt request (INTC20) and a
timer output control signal are generated. This compare register operates as CR20 in the 8-bit mode, and CR20W
in the 16-bit mode.
CR20/CR20W can be read or written to with an 8/16-bit manipulation instruction. The contents of this register are
undefined after RESET input.
(3) Capture/compare register (CR21/CR21W)
CR21/CR21W is an 8/16-bit register that can be specified as a compare register for detecting a match with the TM2/
TM2W count value or a capture register for capturing the TM2/TM2W count value according to the setting of the capture/
compare control register 2 (CRC2).
This capture/compare register operates as CR21 in the 8-bit mode, and CR21W in the 16-bit mode.
CR21/CR21W can be read or written to with an 8/16-bit manipulation instruction.
The contents of this register are undefined after RESET input.
(a) When specified as compare register
CR21/CR21W functions as an 8/16-bit register that holds the value that determines the interval timer operation
cycle.
An interrupt request (INTC21) and a timer output control signal are generated by a match between the contents
of the CR21/CR21W register and the contents of TM2/TM2W.
Also, the count value can be cleared by a match of the contents.
(b) When specified as capture register
CR21/CR21W functions as an 8/16-bit register that captures the contents of TM2/TM2W in synchronization with
the input of a valid edge on the external interrupt input pin (INTP2) (capture trigger).
The contents of the CR21/CR21W register are retained until the next capture trigger is generated.
(4) Capture register (CR22/CR22W)
CR22/CR22W is an 8/16-bit register that captures the contents of TM2/TM2W.
The capture operation is synchronized with the input of a valid edge to the external interrupt request input pin (INTP1)
(capture trigger). The contents of the CR22/CR22W register are retained until the next capture trigger is generated.
Also, TM2/TM2W can be cleared after a capture operation.
This capture register operates as CR22 in the 8-bit mode, and CR22W in the 16-bit mode.
CR22/CR22W can be read only with an 8/16-bit manipulation instruction. The contents of this register are undefined
after RESET input.
310
Preliminary User’s Manual U13987EJ1V0UM00