Datasheet

Table 19-14. Compare Output Mode, Fast PWM
COM4A[1]/
COM4B[1]
COM4A[0]/
COM4B[0]
Description
0 0 Normal port operation, OC4A/OC4B disconnected.
0 1 WGM4[3:0] = 14 or 15: Toggle OC4A on Compare Match, OC4B
disconnected (normal port operation). For all other WGM
settings, normal port operation, OC4A/OC4B disconnected.
1 0 Clear OC4A/OC4B on Compare Match, set OC4A/OC4B at
BOTTOM (non-inverting mode)
1 1 Set OC4A/OC4B on Compare Match, clear OC4A/OC4B at
BOTTOM (inverting mode)
Note: 
1. A special case occurs when OCR4A/OCR4B equals TOP and COM4A[1]/COM4B[1] is set. In this
case, the compare match is ignored, but the set or clear is done at BOTTOM. Refer to Fast PWM
Mode for details.
The table below shows the COM4x[1:0] bit functionality when the WGM4[3:0] bits are set to the phase
correct or the phase and frequency correct, PWM mode.
Table 19-15. Compare Output Mode, Phase Correct, and Phase and Frequency Correct PWM
COM4A[1]/
COM4B[1]
COM4A[0]/
COM4B[0]
Description
0 0 Normal port operation, OC4A/OC4B disconnected.
0 1 WGM4[3:0] = 9 or 11: Toggle OC4A on Compare Match, OC4B
disconnected (normal port operation). For all other WGM4
settings, normal port operation, OC4A/OC4B disconnected.
1 0 Clear OC4A/OC4B on Compare Match when up-counting. Set
OC4A/OC4B on Compare Match when down-counting.
1 1 Set OC4A/OC4B on Compare Match when up-counting. Clear
OC4A/OC4B on Compare Match when down-counting.
Note: 
1. A special case occurs when OCR4A/OCR4B equals TOP and COM4A[1]/COM4B[1] is set. Refer to
Phase Correct PWM Mode for details.
Bits 1:0 – WGM4[1:0] Waveform Generation Mode
Combined with the WGM4[3:2] bits found in the TCCR4B Register, these bits control the counting
sequence of the counter, the source for maximum (TOP) counter value, and what type of waveform
generation to be used. Modes of operation supported by the Timer/Counter unit are; Normal mode
(counter), Clear Timer on Compare Match (CTC) mode, and three types of Pulse Width Modulation
(PWM) modes. (See Modes of Operation).
ATmega328PB
TC1, 3, 4 - 16-bit Timer/Counter1, 3, 4 with PWM
© 2018 Microchip Technology Inc.
Datasheet Complete
DS40001906C-page 199