English
Language : 

UPD78F1502AGK-GAK-AX Datasheet, PDF (353/1031 Pages) Renesas Technology Corp – 16-Bit Single-Chip Microcontrollers
78K0R/Lx3
CHAPTER 6 TIMER ARRAY UNIT
6.8.3 Operation as multiple PWM output function
By extending the PWM function and using two or more slave channels, many PWM output signals can be produced.
For example, when using two slave channels, the period and duty factor of an output pulse can be calculated by the
following expressions.
Pulse period = {Set value of TDRmn (master) + 1} × Count clock period
Duty factor 1 [%] = {Set value of TDRmp (slave 1)}/{Set value of TDRmn (master) + 1} × 100
Duty factor 2 [%] = {Set value of TDRmp (slave 2)}/{Set value of TDRmn (master) + 1} × 100
Remark
Although the duty factor exceeds 100% if the set value of TDRmp (slave 1) > {set value of TDRmn
(master) + 1} or if the {set value of TDRmq (slave 2)} > {set value of TDRmn (master) + 1}, it is
summarized into 100% output.
TCRmn of the master channel operates in the interval timer mode and counts the periods.
TCRmp of the slave channel 1 operates in one-count mode, counts the duty factor, and outputs a PWM waveform from
the TOmp pin. TCRmp loads the value of TDRmp to TCRmp, using INTTMmn of the master channel as a start trigger,
and start counting down. When TCRmp = 0000H, TCRmp outputs INTTMmp and stops counting until the next start trigger
(INTTMmn of the master channel) has been input. The output level of TOmp becomes active one count clock after
generation of INTTMmn from the master channel, and inactive when TCRmp = 0000H.
In the same way as TCRmp of the slave channel 1, TCRmq of the slave channel 2 operates in one-count mode, counts
the duty factor, and outputs a PWM waveform from the TOmq pin. TCRmq loads the value of TDRmq to TCRmq, using
INTTMmn of the master channel as a start trigger, and starts counting down. When TCRmq = 0000H, TCRmq outputs
INTTMmq and stops counting until the next start trigger (INTTMmn of the master channel) has been input. The output
level of TOmq becomes active one count clock after generation of INTTMmn from the master channel, and inactive when
TCRmq = 0000H.
When channel 0 is used as the master channel as described above, up to seven types of PWM signals can be output at
the same time with timer array unit 0 and up to three types with timer array unit 1.
Caution To rewrite both TDRmn of the master channel and TDRmp of the slave channel 1, write access is
necessary at least twice. Since the values of TDRmn and TDRmp are loaded to TCRmn and TCRmp
after INTTMmn is generated from the master channel, if rewriting is performed separately before and
after generation of INTTMmn from the master channel, the TOmp pin cannot output the expected
waveform. To rewrite both TDRmn of the master and TDRmp of the slave, be sure to rewrite both the
registers immediately after INTTMmn is generated from the master channel (This applies also to
TDRmq of the slave channel 2) .
Remarks 1.
2.
3.
78K0R/LF3:
• m = 0, n = 0, 2, p = n+1, q = n+2, TO00 to TO04, and TO07 pins
78K0R/LG3:
• m = 0, n = 0, 2, 4, p = n+1, q = n+2, TO00 to TO07 pins
78K0R/LH3:
• m = 0, n = 0, 2, 4, p = n+1, q = n+2, TO00 to TO07 pins
• m = 1, n = 0, p = 1, q = 2, TO10 to TO13 pins
R01UH0004EJ0501 Rev.5.01
337
Jun 20, 2011