1

I am driving motor using ESC with Hardware PWM signal comes from Raspberry Pi ,I set the GPIO 19 (PIN 35) to be PWM1 , the problem is when the Raspberry Pi startup it gives output value to PWM1 (GPIO 19) which causing the motor to start spinning at slow speed , How can stop that ? I want GPIO 19 to stop sending signal after the startup , unless I do it my self .

NOTE : when the PWM was disabled in (/boot/config.txt) the GPIO 19 was Input ,so its wasn't sending any signal ,But after activating the PWM1 it changed to ALT5 and start giving signal just after startup. enter image description here

5
  • 1
    Why not start hardware PWM with software after boot rather than using /boot/config.txt ?
    – joan
    Nov 2, 2021 at 16:24
  • what do you mean by start hardware PWM with software ? all i need is to use Hardware PWM at GPIO 19 . therefore I must enable it at /boot/config.txt , then reboot , to be ready to use . But the problem is that the PWM is starting automatically just after boot .
    – 0ussama
    Nov 2, 2021 at 16:32
  • 1
    You don't need to enable PWM in /boot/config.txt.
    – joan
    Nov 2, 2021 at 16:38
  • Yes , for hardware one you must enable PWM before you use it , check this : librpip.frasersdev.net/peripheral-config/pwm0and1
    – 0ussama
    Nov 2, 2021 at 17:01
  • 1
    That is incorrect.
    – joan
    Nov 2, 2021 at 17:15

1 Answer 1

1

There are at least 4 libraries supporting hardware PWM; WiringPi (deprecated), pigpio (daemon), Pi.GPIO (python), pi-gpio (c).

All of these allow PWM to be started/stopped programatically at any time.

The kernel code started by dtoverlay uses the deprecated sysfs interface and is undocumented.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.