PWM on the beaglebone black

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

PWM on the beaglebone black

Postby medivhok » Mon Jun 24, 2013 11:17 pm

Hi all,

I've been searching the web on how to use pwm (pulse-width modulation) on the beaglebone black. All I found was people thinking of archlinux as not build for it, and returned to the linux that ship with the bbb. They thought that dtc (device-tree compiler) needed to be patch and installed and a patched kernel should be build. And not just on this forum but by googling too.

Since arch is my favorite distro I search and try a few things (because I didnt know anything about device-tree) and I finally made it! And its easy.

If you try this :

http://elinux.org/EBC_Exercise_13_Pulse_Width_Modulation

it works, but for one exception: the pin muxing. The base of everything is the userspace driver, pwm_test. No need to rebuild the kernel, just download the source file, and build it as a module. Here is the source file and a makefile to build it :

https://github.com/medivhok/beaglebone_black_pwm.git

It's in the pwm_test directory.

After building and installing the driver, sysfs way of doing it will works (first link above) and the pin muxing too. If you want to write device-tree overlay, all you need to do after installing the driver is installing dtc-git-patched

https://aur.archlinux.org/packages/dtc-git-patched/
and build it with
$this->bbcode_second_pass_code('', 'makepkg --asroot -Acs')

So finally, build a driver, (and build an aur package to compile device-tree overlay), all done in a few minutes. This is all it takes to use pwm on the beaglebone with Archlinux.

Just wanted to share this with you all :D
Medivhok
medivhok
 
Posts: 6
Joined: Wed Jun 19, 2013 9:16 pm

Re: PWM on the beaglebone black

Postby xenoxaos » Fri Jun 28, 2013 4:44 pm

Have you tried adding this 'module' into the kernel tree? I would suggest trying that, then forking our repo, adding the patch to the PKGBUILD, build & test. then issue a pull on Github. Then this would be in the kernel for all users and you wouldn't have to rebuild the module every time the kernel is updated.

https://github.com/archlinuxarm/PKGBUIL ... inux-am33x
Arch Linux ARM exists and continues to grow through community support, please donate today!
xenoxaos
Developer
 
Posts: 323
Joined: Thu Jan 06, 2011 1:45 am

Re: PWM on the beaglebone black

Postby medivhok » Sun Jun 30, 2013 3:34 pm

I'm not the author of the module so I prefer not be the one who includes it in the mainline. I have read the code a little but since I'm not a kernel dev, I can't maintain it.

medivhok
medivhok
 
Posts: 6
Joined: Wed Jun 19, 2013 9:16 pm


Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 0 guests