Pulse Width Modulation is well known technique for controlling power electronics devices like SCR, IGBT etc. PWM is also used in motor speed controlling.[[wysiwyg_imageupload::]] Square wave generation by using AVR timers is explained in previous article. The AVR timers have feature of PWM wave generation as well .This article describes PWM generation capability of AVR timers. There are four in-built PWM channels in ATmega16. The PWM outputs are received on pins OC0, OC1A, OC1B and OC2. Readers can refer the previous article which gives explanation of these pins. The Phase correct PWM mode can be selected by assigning bits WGM0[1:0]=01. This mode is based on dual slope operation. In dual slope operation, TCNTn counts from bottom value to maximum value and maximum value to bottom value. The OCRn register compares the value with the TCNTn register constantly during up-counting and down-counting. On compare match PWM output pin (OCn) behaves according to inverting or non-inverting mode which can be selected by programming of COMn [1:0] bits.