UPD784026 Renesas Electronics Corporation., UPD784026 Datasheet - Page 315

no-image

UPD784026

Manufacturer Part Number
UPD784026
Description
16/8-bit Single-chip Microcontrollers
Manufacturer
Renesas Electronics Corporation.
Datasheet
(1) Timer register 2 (TM2/TM2W)
(2) Compare register (CR20/CR20W)
(3) Capture/compare register (CR21/CR21W)
TM2/TM2W is a timer register 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 register can
select to operate in an 8-bit (TM1) or 16-bit (TM1W) 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.
Caution Although the timer register can be read, if counting up the timer and reading the timer register conflict,
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.
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
(b) When specified as capture 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.
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.
Also, TM2/TM2W can be cleared after a capture operation.
the read value of the timer register may be illegal. Therefore, do not read the timer register if at all
possible.
If it is necessary to read the timer register, read it two or more times in a row in software, and assume
the value of the timer register is correct only when all the read values match.
CHAPTER 10 TIMER/COUNTER 2
275

Related parts for UPD784026