Exploration: PWM in Software – Part II
Posted in PWM, arduino, occam-pi on October 19th, 2009 by Radu – Be the first to commentThe last implementation proved to be very slow, so an obvious improvement was to eliminate the ticker; i.e. the dependence on the clock for synchronization. By removing the ticker process we ensure that PWM will run as fast as the virtual machine is. Here is the updated diagram:

PWM in Software (No Clock)
When tested, this implementation runs quite a bit faster – the LED actually gives an impression of dimming. But upon plugging a speaker into the same pin we get a definite “buzzing” noice, when the desired effect is more like a nice sound. Hence, still not fast enough. It is therefore time to read the Arduino data sheet and find out how to do it in hardware.
