O'Reilly logo

Programming the BeagleBone by Yogesh Chavan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

BeagleBone's PWM

PWM can be implemented via program. One can write a program with digitalWrite() and setInterval() to create the desired frequency and desired duty cycle. But context switching and interrupts will make it inaccurate. Also, it will keep the CPU busy. The correct solution is to support this functionality at hardware level inside the CPU. The BeagleBone CPU has a Pulse Width Modulation Subsystem (PWMSS), which allows the accurate creation of a PWM pattern without keeping the CPU busy. The CPU will be free to do other work while the PWM subsystem takes care of the PWM wave generation. This subsystem has control over only a few GPIO pins. It can switch output very fast on these pins and can control on/off timing. So, not all GPIO pins ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required