Table 12-3 on – Rainbow Electronics ATtiny43U User Manual
Page 91

91
8048B–AVR–03/09
shows the COMnA[1:0] bit functionality when the WGMn[1:0] bits are set
to fast PWM mode.
Note:
1. A special case occurs when OCRnA equals TOP and COMnA1 is set. In this case, the Com-
pare Match is ignored, but the set or clear is done at TOP. See
for more details.
shows the COMnA[1:0] bit functionality when the WGMn[2:0] bits are set
to phase correct PWM mode.
Note:
1. A special case occurs when OCRnA equals TOP and COMnA1 is set. In this case, the Com-
pare Match is ignored, but the set or clear is done at TOP. See
for more details.
• Bits 5:4 – COMnB[1:0]: Compare Match Output B Mode
These bits control the Output Compare pin (OCnB) behavior. If one or both of the COMnB1:0
bits are set, the OCnB output overrides the normal port functionality of the I/O pin it is connected
to. However, note that the Data Direction Register (DDR) bit corresponding to the OCnB pin
must be set in order to enable the output driver.
When OCnB is connected to the pin, the function of the COMnB[1:0] bits depends on the
WGMn[2:0] bit setting.
shows the COMnB[1:0] bit functionality when the
WGMn[2:0] bits are set to a normal or CTC mode (non-PWM).
Table 12-3.
Compare Output Mode, Fast PWM Mode
COMnA1
COMnA0
Description
0
0
Normal port operation, OCnA disconnected.
0
1
WGMn2 = 0: Normal Port Operation, OCnA Disconnected.
WGMn2 = 1: Toggle OCnA on Compare Match.
1
0
Clear OCnA on Compare Match, set OCnA at TOP
1
1
Set OCnA on Compare Match, clear OCnA at TOP
Table 12-4.
Compare Output Mode, Phase Correct PWM Mode
COMnA1
COMnA0
Description
0
0
Normal port operation, OCnA disconnected.
0
1
WGMn2 = 0: Normal Port Operation, OCnA Disconnected.
WGMn2 = 1: Toggle OCnA on Compare Match.
1
0
Clear OCnA on Compare Match when up-counting. Set OCnA on
Compare Match when down-counting.
1
1
Set OCnA on Compare Match when up-counting. Clear OCnA on
Compare Match when down-counting.
Table 12-5.
Compare Output Mode, non-PWM Mode
COMnB1
COMnB0
Description
0
0
Normal port operation, OCnB disconnected.
0
1
Toggle OCnB on Compare Match
1
0
Clear OCnB on Compare Match
1
1
Set OCnB on Compare Match