Jump to content

BeagleBone PWM Diagnostic Tool

Recommended Posts

From the Beagleboard google groups.
Github link.

while playing with PWM on BeagleBone I created Python script for tests. It can handle 6 PWM channels on 8 pins (no eCap). Hope it'll be useful.

usage: bbpwm [-h] [-f FREQUENCY] [-d DUTY] [--version] [--stop] [-v]
BeagleBone PWM diagnostic utility.
positional arguments:
{1,2,3,4,5,6,60,50} PWM channel
optional arguments:
-h, --help show this help message and exit
Frequency [Hz]
-d DUTY, --duty DUTY Duty cycle [%]
--version show program's version number and exit
--stop Stop PWM. To start again PWM specify frequency or/and
duty cycle.
-v, --verbose Display more messages.
--no-timer-set Do not set timer mode for PWM. Use only if kernel
already set the timer.
bbpwm -d 50 -f 10000 1
Sets 10 kHz and 50% duty cycle for channel 1.
bbpwm -v -d 80 4
Sets only duty cycle for channel 4 and display more messages.
bbpwm --stop 2
Stop PWM on channel 2.
Supported BeagleBone PWM pins:
1 P9.14 gpmc_a2 EHRPWM1A /sys/class/pwm/ehrpwm.1:0
2 P9.16 gpmc_a3 EHRPWM1B /sys/class/pwm/ehrpwm.1:1
3 P8.19 gpmc_ad8 EHRPWM2A /sys/class/pwm/ehrpwm.2:0
4 P8.13 gpmc_ad9 EHRPWM2B /sys/class/pwm/ehrpwm.2:1
5 P9.31 mcasp0_fsx EHRPWM0A /sys/class/pwm/ehrpwm.0:0
6 P9.29 mcasp0_aclkx EHRPWM0B /sys/class/pwm/ehrpwm.0:1
50 P9.22 spi0_sclk EHRPWM0A /sys/class/pwm/ehrpwm.0:0
60 P9.21 spi0_d0 EHRPWM0B /sys/class/pwm/ehrpwm.0:1
PWM amplitude is 3.3V.
eCAP 2 additional PWM channels not supported.
PIN is MODE 0 name, NOT BeagleBone System Reference Manual signal name.
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...