RaspberryPi 4 GPIO - Use internal Pull-Up/Down Resistors

More
29 Dec 2022 22:38 #260514 by Maschde
Hi everyone,

i am currently using a RaspberryPi 4 for my DIY 3-axis CNC mill.
At connecting my sensors to the GPIOs i noticed that some inputs are per default high, others low.
I can't find a function anywhere in hal_pi_gpio.c that sets the internal resistors.
In the included "bcm2835.h" a function declaired but it seems that this is not used.
Is it possible to set the resistors in hal_pi_gpio.c?

I know that GPIO 2 and 3 are exceptions because of the permanently installed resistiors.

Thank you guys

Please Log in or Create an account to join the conversation.

More
30 Dec 2022 07:28 #260539 by elovalvo
Unfortunately it is not possible, at the moment, to set the resistors directly from hal_pi_gpio.

The solution I use 

forum.linuxcnc.org/9-installing-linuxcnc...ware-stepping#260086

is to use a command file (initgpio.txt), based on the raspi-gpio command 

github.com/RPi-Distro/raspi-gpio

to run before launching LinuxCNC

Please Log in or Create an account to join the conversation.

More
31 Dec 2022 07:52 #260624 by Maschde
Thank you very much, i will try it.
I think i get it working.

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum