Page 1 of 1

PWM capture mode

Posted: 2025-06-01 14:58
by pgridin
In rk3506g2 datasheet says that pwm has a capture mode.
Is this function implemented in drivers?
Thunks

Re: PWM capture mode

Posted: 2025-06-04 3:11
by Crocodile
Hello, the capture mode of PWM is enabled by default. After inputting the PWM signal to the pin, you can view it by using the command.

Code: Select all

# X should be adjusted according to the actual situation 
echo 0 > /sys/class/pwm/pwmchipX/export 
cat /sys/class/pwm/pwmchipX/pwm0/capture
Note: Once the "enable" setting is set to 1, the system will enter the output mode and will no longer be able to capture.

Code: Select all

echo 1 >  /sys/class/pwm/pwmchipX/pwm0/enable

Re: PWM capture mode

Posted: 2025-06-04 18:29
by pgridin
Thanks!!!