While using the duty_cycle as 2000000 you will have ~40.64%. In order to calculate the duty cycle you want to use and the number you have to put in
/sys/class/pwm/pwmchip0/pwmX/duty_cycle you need to know that 4950495 is 100%.
You can use the following equivalence:
DutyCycle * 4950495
Where duty_cycle is the value in /sys/class/pwm/pwmchip0/pwmX/duty_cycle and DutyCycle is the %Duty cycle you want to use. For example if you want to use 40% as DutyCycle you will have as result 1980198.
1 of 1 people found this helpful
Hi Charlie，thanks very much!