Datasheet

98
ATtiny828 [DATASHEET]
8371A–AVR–08/12
When OC0A is connected to the pin, the function of the COM0A[1:0] bits depends on the WGM0[2:0] bit setting. Table 30
shows the COM0A[1:0] bit functionality when the WGM0[2:0] bits are set to a normal or CTC mode (non-PWM).
Table 30. Compare Output Mode, non-PWM Mode
Table 31 shows COM0A[1:0] bit functionality when WGM0[2:0] bits are set to fast PWM mode.
Table 31. Compare Output Mode, Fast PWM Mode
Note: 1. A special case occurs when OCR0A equals TOP and COM0A1 is set. In this case, the Compare Match is
ignored, but the set or clear is done at BOTTOM. See “Fast PWM Mode” on page 93 for more details.
Table 32 shows COM0A[1:0] bit functionality when WGM0[2:0] bits are set to phase correct PWM mode.
Table 32. Compare Output Mode, Phase Correct PWM Mode
Note: 1. When OCR0A equals TOP and COM0A1 is set, the Compare Match is ignored, but the set or clear is done
at TOP. See “Phase Correct PWM Mode” on page 94 for more details.
COM0A1 COM0A0 Description
0 0 Normal port operation, OC0A disconnected.
0 1 Toggle OC0A on Compare Match
1 0 Clear OC0A on Compare Match
1 1 Set OC0A on Compare Match
COM0A1 COM0A0 Description
0 0 Normal port operation, OC0A disconnected
0 1
WGM02 = 0: Normal Port Operation, OC0A Disconnected
WGM02 = 1: Toggle OC0A on Compare Match
1 0
Clear OC0A on Compare Match
Set OC0A at BOTTOM (non-inverting mode)
1 1
Set OC0A on Compare Match
Clear OC0A at BOTTOM (inverting mode)
COM0A1 COM0A0 Description
0 0 Normal port operation, OC0A disconnected.
0 1
WGM02 = 0: Normal Port Operation, OC0A Disconnected.
WGM02 = 1: Toggle OC0A on Compare Match.
1 0
Clear OC0A on Compare Match when up-counting. Set OC0A on Compare Match
when down-counting.
1 1
Set OC0A on Compare Match when up-counting. Clear OC0A on Compare Match
when down-counting.