Datasheet

151
7766F–AVR–11/10
ATmega16/32U4
The Output Compare Pin configurations in Normal Mode are described in Table 15-2.
15.8.2 Fast PWM Mode
The fast Pulse Width Modulation or fast PWM mode (PWM4x = 1 and WGM40 = 0) provides a
high frequency PWM waveform generation option. The fast PWM differs from the other PWM
option by its single-slope operation. The counter counts from BOTTOM to TOP (defined as
OCR4C) then restarts from BOTTOM. In non-inverting Compare Output mode the Waveform
Output (OCW4x) is cleared on the Compare Match between TCNT4 and OCR4x and set at
BOTTOM. In inverting Compare Output mode, the Waveform Output is set on Compare Match
and cleared at BOTTOM. In complementary Compare Output mode the Waveform Output is
cleared on the Compare Match and set at BOTTOM.
Due to the single-slope operation, the operating frequency of the fast PWM mode can be twice
as high as the Phase and Frequency Correct PWM mode that use dual-slope operation. This
high frequency makes the fast PWM mode well suited for power regulation, rectification, and
DAC applications. High frequency allows physically small sized external components (coils,
capacitors), and therefore reduces total system cost.
The timing diagram for the fast PWM mode is shown in Figure 15-13. The counter is incre-
mented until the counter value matches the TOP value. The counter is then cleared at the
following timer clock cycle. The TCNT4 value is in the timing diagram shown as a histogram for
illustrating the single-slope operation. The diagram includes the Waveform Output in non-
inverted and inverted Compare Output modes. The small horizontal line marks on the TCNT4
slopes represent Compare Matches between OCR4x and TCNT4.
Figure 15-13. Fast PWM Mode, Timing Diagram
Table 15-2. Output Compare Pin Configurations in Normal Mode
COM4x1 COM4x0 OC4x Pin OC4x Pin
0 0 Disconnected Disconnected
0 1 Disconnected OC4x
1 0 Disconnected OC4x
1 1 Disconnected OC4x
TCNTn
OCRnx Update and
TOVn Interrupt Flag Set
1
Period
2 3
OCWnx
OCWnx
(COMnx1:0 = 2)
(COMnx1:0 = 3)
OCRnx Interrupt Flag Set
4 5 6 7