English
Language : 

UPD78F1502AGK-GAK-AX Datasheet, PDF (315/1031 Pages) Renesas Technology Corp – 16-Bit Single-Chip Microcontrollers
78K0R/Lx3
CHAPTER 6 TIMER ARRAY UNIT
6.7 Operation of Timer Array Unit as Independent Channel
6.7.1 Operation as interval timer/square wave output
(1) Interval timer
The timer array unit can be used as a reference timer that generates INTTMmn (timer interrupt) at fixed intervals.
The interrupt generation period can be calculated by the following expression.
Generation period of INTTMmn (timer interrupt) = Period of count clock × (Set value of TDRmn + 1)
(2) Operation as square wave output
TOpq performs a toggle operation as soon as INTTMpq has been generated, and outputs a square wave with a
duty factor of 50%.
The period and frequency for outputting a square wave from TOpq can be calculated by the following expressions.
• Period of square wave output from TOpq = Period of count clock × (Set value of TDRpq + 1) × 2
• Frequency of square wave output from TOpq = Frequency of count clock/{(Set value of TDRpq + 1) × 2}
The valid edge of TIpq pin input signal, the valid edge of fSUB/2, the valid edge of fSUB/4, or the valid edge of
INTRTC1 can be selected as the count clock, in addition to CKm0 and CKm1. Consequently, the interval timer can
be operated, regardless of the fCLK frequency (main system clock, subsystem clock).
When changing the clock selected as fCLK (changing the value of the system clock control register (CKC)), stop the
timer array units 0 and 1 (TAUS0, TAUS1) (TT0 = 00FFH, TT1 = 000FH) first.
Only in the case of SDIV=0, CCSmn=1 and TISmn=1, continuously use of TAUm is allowed, even when changing
CPU clock. However, the following limitation is existing.
• When changing CPU clock, source clock decrease/increase occurs as follows.
Main clock → Subsystem clock (CSS = 0→1): −1 clock
Subsystem clock → Main clock (CSS = 1→0): +1 clock
TCRmn operates as a down counter in the interval timer mode.
TCRmn loads the value of TDRmn at the first count clock after the channel start trigger bit (TSmn) is set to 1. If
MDmn0 of TMRmn = 0 at this time, INTTMmn is not output and TOpq is not toggled. If MDmn0 of TMRmn = 1,
INTTMmn is output and TOpq is toggled.
After that, TCRmn count down in synchronization with the count clock.
When TCRmn = 0000H, INTTMmn is output and TOpq is toggled at the next count clock. At the same time,
TCRmn loads the value of TDRmn again. After that, the same operation is repeated.
TDRmn can be rewritten at any time. The new value of TDRmn becomes valid from the next period.
R01UH0004EJ0501 Rev.5.01
299
Jun 20, 2011