RL78/G10 CHAPTER 6 TIMER ARRAY UNIT
R01UH0384EJ0311 Rev. 3.11 157
Dec 22, 2016
6.8 Independent Channel Operation Function of Timer Array Unit
6.8.1 Operation as interval timer/square wave output
(1) Interval timer
The timer array unit can be used as a reference timer that generates the interrupt request signal (INTTM0n) at fixed
intervals.
The INTTM0n generation period can be calculated by the following expression.
Generation period of INTTM0n = Period of count clock × (Set value of TDR0n + 1)
When channel 1 or 3 is used as an 8-bit timer (SPLIT0n = 1), both the higher and lower 8-bit timers can be used as
interval timers.
(2) Operation as square wave output
The TO0n pin performs a toggle operation as soon as INTTM0n has been generated, and outputs a square wave
with a duty factor of 50%.
The period and frequency for outputting a square wave from TO0n can be calculated by the following expressions.
• Period of square wave output from TO0n pin = Period of count clock × (Set value of TDR0n + 1) × 2
• Frequency of square wave output from TO0n pin = Frequency of count clock/{(Set value of TDR0n + 1) × 2}
When channel 1 or 3 is used as an 8-bit timer (SPLIT0n = 1), only the lower 8-bit timer can be used for square
wave output.
The timer count register 0n (TCR0n) operates as a down counter in the interval timer mode.
The TCR0n register loads the value of the timer data register 0n (TDR0n) at the first count clock after the channel
start trigger bit (TS0n, TSH01, TSH03) of the timer channel start register 0 (TS0, TSH0) is set to 1. If the MD0n0
bit of timer mode register 0n (TMR0n) is 0 at this time, INTTM0n is not output and TO0n is not toggled. If the
MD0n0 bit of the TMR0n register is 1, INTTM0n is output and TO0n is toggled.
After that, the TCR0n register count down in synchronization with the count clock.
When TCR0n = 0000H, INTTM0n is output and TO0n is toggled at the next count clock. At the same time, the
TCR0n register loads the value of the TDR0n register again. After that, the same operation is repeated.
The TDR0n register can be rewritten at any time. The new value of the TDR0n register becomes valid from the
next period.
Remark n: Channel number
n = 0, 1 (for 10-pin products); n = 0 to 3 (for 16-pin products)