Table 54, Table 55 f, Atmega162/v – Rainbow Electronics ATmega162V User Manual
Page 128
128
ATmega162/V
2513E–AVR–09/03
Table 54 shows the COMnx1:0 bit functionality when the WGMn3:0 bits are set to the
fast PWM mode.
Note:
1. A special case occurs when OCRnA/OCRnB equals TOP and COMnA1/COMnB1 is
set. In this case the Compare Match is ignored, but the set or clear is done at TOP.
See “Fast PWM Mode” on page 119. for more details.
Table 55 shows the COMnx1:0 bit functionality when the WGMn3:0 bits are set to the
phase correct or the phase and frequency correct, PWM mode.
Note:
1. A special case occurs when OCRnA/OCRnB equals TOP and COMnA1/COMnB1 is
set. See “Phase Correct PWM Mode” on page 121. for more details.
• Bit 3 – FOCnA: Force Output Compare for channel A
• Bit 2 – FOCnB: Force Output Compare for channel B
The FOCnA/FOCnB bits are only active when the WGMn3:0 bits specifies a non-PWM
mode. However, for ensuring compatibility with future devices, these bits must be set to
zero when TCCRnA is written when operating in a PWM mode. When writing a logical
one to the FOCnA/FOCnB bit, an immediate Compare Match is forced on the Waveform
Generation unit. The OCnA/OCnB output is changed according to its COMnx1:0 bits
setting. Note that the FOCnA/FOCnB bits are implemented as strobes. Therefore it is
the value present in the COMnx1:0 bits that determine the effect of the forced compare.
A FOCnA/FOCnB strobe will not generate any interrupt nor will it clear the timer in Clear
Timer on Compare match (CTC) mode using OCRnA as TOP.
The FOCnA/FOCnB bits are always read as zero.
Table 54. Compare Output Mode, Fast PWM
COMnA1/
COMnB1
COMnA0/
COMnB0
Description
0
0
Normal port operation, OCnA/OCnB disconnected.
0
1
WGMn3:0 = 15: Toggle OCnA on Compare Match, OCnB
disconnected (normal port operation). For all other WGMn
settings, normal port operation, OCnA/OCnB disconnected.
1
0
Clear OCnA/OCnB on Compare Match, set OCnA/OCnB at TOP.
1
1
Set OCnA/OCnB on Compare Match, clear OCnA/OCnB at TOP.
Table 55. Compare Output Mode, Phase Correct and Phase and Frequency Correct
PWM
COMnA1/
COMnB1
COMnA0
COMnB0
Description
0
0
Normal port operation, OCnA/OCnB disconnected.
0
1
WGMn3:0 = 9 or 14: Toggle OCnA on Compare Match, OCnB
disconnected (normal port operation). For all other WGMn
settings, normal port operation, OCnA/OCnB disconnected.
1
0
Clear OCnA/OCnB on Compare Match when up-counting. Set
OCnA/OCnB on Compare Match when down-counting.
1
1
Set OCnA/OCnB on Compare Match when up-counting. Clear
OCnA/OCnB on Compare Match when down-counting.