Debugging PWM GPIO
This section describes how to debug PWM GPIO:
-
Execute the following to configure the PWM channel:
cd /sys/class/pwm/pwmchip0 echo 0 > export
-
Execute the following to configure the PWM period:
cd pwm0 echo 5000000 > period
-
Execute the following to configure the PWM duty cycle:
echo 1000000 > duty_cycle
-
Use an oscilloscope to measure the corresponding pin and check the PWM period and duty
cycle.
Note:
A duty cycle is the fraction of one period in which a signal or system is active.