Is the sysfs pwm interface using hardware pwm?

社会主义新天地 提交于 2019-12-11 10:27:12

问题


I followed this answer to enable PWM on my Beaglebone Black, but I wasn't sure if that method is using the PRU to do hardware PWM or if it's toggling the pin in software? I see other references to /sys/class/pwm/ehrpwm (e.g. here) which I'm more confident is hardware PWM, but I'm not sure how to enable that interface.

To summarize how I'm enabling PWM:

echo am33xx_pwm > /sys/devices/bone_capemgr.9/slots
echo cape-universal > /sys/devices/bone_capemgr.9/slots
config-pin P8.13 pwm
echo 6 > /sys/class/pwm/export
echo 1 > /sys/class/pwm/pwm6/run
echo 50000 > /sys/class/pwm/pwm6/period_ns
echo 50000 > /sys/class/pwm/pwm6/duty_ns

Thanks!


回答1:


Yup, that's using the hardware PWM modules - the am33xx_pwm overlay enables all the different PWM subsystems (eHRPWM, eCAP), then the PWM kernel driver configures the corresponding PWM module for the pin being configured.



来源:https://stackoverflow.com/questions/33512925/is-the-sysfs-pwm-interface-using-hardware-pwm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!