The important factor is that the percentage of the cycle for which the output is high can be varied. This is the pulse width in the name, and is more commonly referred to as the duty cycle, with 100% being high all the time, 50% being high 50% of the time and low 50% of the time.
For PWM to work perfectly you need a load that will smooth the output slightly. This is true if the load has some capacitance or inductance, which most do. If you just set your output to a fast 50% duty cycle square wave then the load would experience that as a smooth output at half the supply voltage.
This is the key point; the cycles are fast enough that the load experiences them as merely the average voltage from a couple of cycles. This average voltage depends on the duty cycle – 100% duty cycle means the average voltage over the cycle is 100% of supply voltage, and so on.
So start with a 100% duty cycle, and slowly reduce to 0%. The load will experience this as a slowly reducing voltage, just like you would get out of an analogue supply. Now ramp the duty cycle up and down and hey presto you have a sine wave!
Latest Answers