Datasheet

339
1
2
3
4
5
6
PWM mode
Select counter clock
Select waveform output level
Set TGR
Select PWM mode
Start counting
PWM mode
Select counter clear source
Figure 12.24 Procedure for Selecting the PWM Mode
PWM Mode Operation Examples—PWM Mode 1 (Figure 12.25): A TGRA register compare-
match is used as a TCNT counter clear source, the TGRA register initial output value and output
compare output value are both 0, and the TGRB register output compare output value is a 1. In this
example, the value established in the TGRA register becomes the period and the value established
in the TGRB register becomes the duty cycle.
Counter cleared by TGRA compare match
TCNT value
TGRA
TGRB
H'0000
TIOCA
Time
Figure 12.25 PWM Mode Operation Example (Mode 1)