Hobbyist Toolkit

Showing results for 
Search instead for 
Did you mean: 

Beaglebone Black PWM pins

Go to solution

What are the PWM pin numbers ? 

0 Kudos
Message 1 of 7



check it out.



Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
0 Kudos
Message 2 of 7

Thank you for the information. Do I use "60" for example as the PWM channel #?

0 Kudos
Message 3 of 7
Accepted by andywong1026

Now I figured out. PWM channel # are 60,62,13,19. Duty cycle setting from 0 to 1; not 0 to 255 as stated in the Context Help!

0 Kudos
Message 4 of 7



I am also trying to get the PWM from the examples in Labview to work on a Beagle Bone Black. I tried the channels 60, 62 and 13. But none of these seem to work.


Were you able to get the PWM working on the Beagle Bone Black?

Which channel did you configure the PWM?

What was the frequency of operation of the PWM?


I am not able to get the PWM working. Please share me your thoughts.




0 Kudos
Message 5 of 7

Duty cycle setting from 0 to 1; not 0 to 255 as stated in the Context 

0 Kudos
Message 6 of 7

Thank you. I agree with you.


I was able to make the necessary changes in PWM and I was able to run the Labview program on BBB. However, there were few more steps I had to do to make it work.


1. First, I followed the steps as mentioned in the link below.

Build .so On Target [LabVIEW MakerHub]

With this I was able to edit the file with name LinxBeagleBoneBlack.cpp where I changed the PWM frequency. I then compiled using Makefile and threw the .so file created to the folder usr/bin. But after I still found the PWM not working on BBB.


2. I came across some test codes that was available under the LINX folder. Please have the link below. 

LINX/LabVIEW/vi.lib/MakerHub/LINX/Firmware/Source/tests/src at main · LVMakerHub/LINX · GitHub

These helped to find if PWM was working on the BBB.

Since my PWMs were not working, I put in some println statements to see the code execution flow. And thats when I came to understand that there was difference in the path. I was running on kernel 5.10 of debian and I found that the right path for the PWMs were:- 


P9.14 sys/ class/pwm/pwmchip5/pwm0
P9.16 sys/ class/pwm/pwmchip5/pwm1
P8:13 sys/ class/pwm/pwmchip7/pwm1
P8:19 sys/ class/pwm/pwmchip7/pwm0


I think the existing Linx code was built for some other previous kernel versions and they had a slightly different path for PWM access. Those version don't have pwmchip5, pwmchip7 etc.


So after I included these changes on the path in the LinxBeagleBoneBlack.cpp, I recompiled it and threw the .so file in the folder usr/lib. After this when I ran the test codes, my PWMs started working. Please note that when you run the PWM duty cycle test code, the duty cycle range is from 0 to 250 for test codes. Now that was a relief because now I know that the LabVIEW .so file is working fine on the BBB. Next step was to run a PWM code from the Labview on the laptop.


3. Third, I tried to run the PWM from the Labview in the laptop by connecting a BBB. I found that it was still not working. So I went deep inside the .VI file for the PWM block provided for Linx peripheral and then I found the default configuration set was DI (which means Digital Input). So I changed it to PWM in the VI block diagram of the PWM (deep inside). After this I flashed the code to BBB through the Labview, and then the PWM worked, meaning I was able to control using the knob in the Labview. It worked. Please note:- that the duty cycle that was set for PWM was from 0 to 1.


Message 7 of 7