73
ATtiny4/5/9/10 [DATASHEET]
8127F–AVR–02/2013
When OC0A or OC0B is connected to the pin, the function of COM0x1:0 bits depends on the WGM03:0 bits.
Table11-2 shows the COM0x1:0 bit functionality when the WGM03:0 bits are set to a Normal or CTC (non-PWM) Mode.
Table 11-3 shows the COM0x1:0 bit functionality when the WGM03:0 bits are set to one of the Fast PWM Modes.
Note:
1. A special case occurs when OCR0A/OCR0B equals TOP and COM0A1/COM0B1 is set. In this case the compare
Table 11-4 shows the COM0x1:0 bit functionality when the WGM03:0 bits are set to the phase correct or the phase
and frequency correct, PWM mode.
Note:
1. A special case occurs when OCR0A/OCR0B equals TOP and COM0A1/COM0B1 is set.
“Phase Correct PWM Bits 1:0 – WGM01:0: Waveform Generation Mode
Combined with WGM03:2 bits of TCCR0B, these bits control the counting sequence of the counter, the source for
maximum (TOP) counter value, and what type of waveform to generate. See
Table 11-5. Modes of operation sup-
Table 11-2.
Compare Output in Non-PWM Modes
COM0A1/
COM0B1
COM0A0
COM0B0
Description
0
Normal port operation: OC0A/OC0B disconnected
1
Toggle OC0A/OC0B on compare match
1
0
Clear (set low) OC0A/OC0B on compare match
1
Set (high) OC0A/OC0B on compare match
Table 11-3.
Compare Output in Fast PWM Modes
COM0A1/
COM0B1
COM0A0/
COM0B0
Description
0
Normal port operation: OC0A/OC0B disconnected
1
WGM03 = 0: Normal port operation, OC0A/OC0B disconnected
WGM03 = 1: Toggle OC0A on compare match, OC0B reserved
1
0
Clear OC0A/OC0B on compare match
Set OC0A/OC0B at BOTTOM (non-inverting mode)
1
Set OC0A/OC0B on compare match
Clear OC0A/OC0B at BOTTOM (inverting mode)
Table 11-4.
Compare Output in Phase Correct and Phase & Frequency Correct PWM Modes
COM0A1/
COM0B1
COM0A0/
COM0B0
Description
0
Normal port operation: OC0A/OC0B disconnected.
1
WGM03 = 0: Normal port operation, OC0A/OC0B disconnected
WGM03 = 1: Toggle OC0A on compare match, OC0B reserved
1
0
Counting up: Clear OC0A/OC0B on compare match
Counting down: Set OC0A/OC0B on compare match
1
Counting up: Set OC0A/OC0B on compare match
Counting down: Clear OC0A/OC0B on compare match