How to make pwm in pic16f877a?


Joined Mar 2, 2015
If generating a PWM using a PIC16F877 is too complicated, and a 555 is also too complicated, try an LTC6992-- a single-chip PWM generator with only three external parts. The frequency of the PWM output is programmed with a single resistor plus a pair of resistors arranged as a voltage divider. A 0-1 volt input controls the duty cycle of the PWM.

It doesn't get any simpler than that. If it's too complicated for you, you probably shouldn't be playing with electronics. And don't bother asking for the circuit or how to use it-- I'm not going to explain it to you. Read the data sheet instead, as it explains everything.


Joined Apr 24, 2011
how to understand and build basic pwm without 555
diffrent wave form like sawtoth
For that you just need a comparator, similar to an op amp where the output is high when the + input is greater than the - input, and the output is low when + in is lower than - in.

The sawtooth or any linear wave is applied to the + in, and the control voltage to the - in.

When control < sawtooth you get a constant high out. 100% pulse

When control > sawtooth you get a constant low out. 0% pulse

When control between the min and max of the sawtooth you get a controlled pulse width between 0 and 100%