EBC Exercise 13 Pulse Width Modulation

In a previous exercise (EBC Exercise 11 gpio Polling and Interrupts) you saw how to use the gpio to produce a square wave out using a C program and sysfs. I was able to get a 1.5kHz square wave out; however we can do much better using some built in hardware on the Beagle.

In this exercise you will learn how to use the Beagle's pulse width modulation (pwm) hardware using the sysfs interface.

Pulse Width Modulation

(Note: The pwm interface seems to changing. Some of this may not apply in the future.)

We have to run a couple of commands to make the PWM interface appear. Try