CHAPTER 7 TIMER ARRAY UNIT
Page 194 of 920
7.8
Independent Channel Operation Function of Timer Array Unit
7.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 INTTMmn (timer interrupt) at fixed
intervals.
The interrupt generation period can be calculated by the following expression.
(2) Operation as square wave output
TOmn performs a toggle operation as soon as INTTMmn has been generated, and outputs a square wave
with a duty factor of 50%.
The period and frequency for outputting a square wave from TOmn can be calculated by the following
expressions.
Timer count register mn (TCRmn) operates as a down counter in the interval timer mode.
The TCRmn register loads the value of timer data register mn (TDRmn) at the first count clock after the
channel start trigger bit (TSmn, TSHm1, TSHm3) of timer channel start register m (TSm) is set to 1. If the
MDmn0 bit of timer mode register mn (TMRmn) is 0 at this time, INTTMmn is not output and TOmn is not
toggled. If the MDmn0 bit of the TMRmn register is 1, INTTMmn is output and TOmn is toggled.
After that, the TCRmn register count down in synchronization with the count clock.
When TCRmn = 0000H, INTTMmn is output and TOmn is toggled at the next count clock. At the same time,
the TCRmn register loads the value of the TDRmn register again. After that, the same operation is
repeated.
The TDRmn register can be rewritten at any time. The new value of the TDRmn register becomes valid from
the next period.
Remark
m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3)
Generation period of INTTMmn (timer interrupt) = Period of count clock
×
(Set value of TDRmn + 1)
• Period of square wave output from TOmn = Period of count clock
×
(Set value of TDRmn + 1)
×
2
• Frequency of square wave output from TOmn = Frequency of count clock/{(Set value of TDRmn + 1)
×
2}
Summary of Contents for RL78/G1H
Page 941: ...R01UH0575EJ0120 RL78 G1H...