English
Language : 

ATMEGA8_08 Datasheet, PDF (118/308 Pages) ATMEL Corporation – 8-bit with 8K Bytes In-System Programmable Flash
Table 43. Compare Output Mode, Non-PWM Mode
COM21
COM20 Description
0
0
Normal port operation, OC2 disconnected.
0
1
Toggle OC2 on Compare Match
1
0
Clear OC2 on Compare Match
1
1
Set OC2 on Compare Match
Table 44 shows the COM21:0 bit functionality when the WGM21:0 bits are set to fast PWM
mode.
Table 44. Compare Output Mode, Fast PWM Mode(1)
COM21
COM20 Description
0
0
Normal port operation, OC2 disconnected.
0
1
Reserved
1
0
Clear OC2 on Compare Match, set OC2 at BOTTOM,
(non-inverting mode)
1
1
Set OC2 on Compare Match, clear OC2 at BOTTOM,
(inverting mode)
Note:
1. A special case occurs when OCR2 equals TOP and COM21 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 112
for more details.
Table 45 shows the COM21:0 bit functionality when the WGM21:0 bits are set to phase correct
PWM mode.
Table 45. Compare Output Mode, Phase Correct PWM Mode(1)
COM21 COM20 Description
0
0
Normal port operation, OC2 disconnected.
0
1
Reserved
1
0
Clear OC2 on Compare Match when up-counting. Set OC2 on Compare
Match when downcounting.
1
Note:
1
Set OC2 on Compare Match when up-counting. Clear OC2 on Compare
Match when downcounting.
1. A special case occurs when OCR2 equals TOP and COM21 is set. In this case, the Compare
Match is ignored, but the set or clear is done at TOP. See “Phase Correct PWM Mode” on page
113 for more details.
118 ATmega8(L)
2486T–AVR–05/08