Debugging PWM GPIO

This section describes how to debug PWM GPIO:

  1. Execute the following to configure the PWM channel:
    cd /sys/class/pwm/pwmchip0
    echo 0 > export
  2. Execute the following to configure the PWM period:
    cd pwm0
    echo 5000000 > period
  3. Execute the following to configure the PWM duty cycle:
    echo 1000000 > duty_cycle
  4. 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.