Phase Correct PWM With ATmega328P - Ee-diary
Maybe your like
Phase Correct PWM mode
The Phase Correct PWM mode is used to generate PWM signal at the output compare pins(either OC0A or OC0B depending upon which output compare unit A or B is used). It is called Phase Correct PWM because the generated PWM signal has symmetrical waveform nature which is due to its dual-slope nature of operation.

Modes of Phase Correct PWM mode
There are two Phase Correct PWM modes for Timer/Counter 0 unit. They are mode 1 and mode 5 which are selected using the waveform generation mode bits(WGM02, WGM01, WGM00) located in the TCCR0A and TCCR0B registers. The following table shows the WGM bits combination for mode 1 and mode 5.

The WGM02 bit is located in the TCCR0B register as shown below.

The WGM01 and WGM00 bits are located in the TCCR0A register as shown below.
The difference between the mode 1 Phase Correct PWM and mode 5 Phase Correct PWM is the TOP value. For mode 1 the TOP value is is 0xFF whereas the the TOP value for mode 5 is OCR0A. If mode 5 is used then we have to load count value into the OCR0A register. If mode 1 is used then we don't have to load the counter since the TOP value in this case is 0xFF. Once the mode is selected the counter is started and the timer/counter starts counting from zero to TOP value and when TOP value is reached the counting is repeated from the bottom.
Types of Fast PWM mode
There are two types of Phase Correct PWM modes:
(a) non-inverting Phase Correct PWM
(b) inverting Phase Correct PWM.
The Compare Output Mode bits (COM0A1 and COM0A0) located in the TCCR0A register are used to set up non-inverting or inverting mode for the output at OC0A pin. The following table shows how to select the COM0A1 and COM0A0 bits.

Similarly, the Compare Output Mode bits (COM0B1 and COM0B0) located in the TCCR0A register are used to set up non-inverting or inverting mode for the output at OC0B pin. The following table shows how to select the COM0B1 and COM0B0 bits.
Following picture shows the timing diagram for Phase Correct PWM which includes non-inverted and inverted PWM outputs.
Tag » Arduino Uno Phase Correct Pwm
-
Secrets Of Arduino PWM | Arduino Documentation
-
Phase Correct PWM Library? - Arduino Forum
-
Arduino Phase Correct PWM For DC To DC Converter - YouTube
-
Tutorial On Fast Pulse Width Modulation - Arxterra
-
How To Modify The PWM Frequency On The Arduino-part2(Timer 1 And ...
-
Generating An Arduino 16-bit PWM | Microcontroller Tutorials
-
28.3: Fast PWM Mode - Engineering LibreTexts
-
How To Change The PWM Frequency Of Arduino - NerdyTechy
-
Timer Und PWM – Teil 1 (8 Bit Timer0/2) - Wolles Elektronikkiste
-
Timer Und PWM – Teil 2 (16 Bit Timer1) - Wolles Elektronikkiste
-
[PDF] Secrets Of Arduino PWM - Lars . Mec . Ua . Pt
-
What Is The Difference Between 'normal' PWM And Fast PWM? - Quora