Raspberry: issue configuring GPIO 21 (pin 40) as output
06 Mar 2022 22:23 #236538
by Guglielmi
Raspberry: issue configuring GPIO 21 (pin 40) as output was created by Guglielmi
Hello,
it's very strange but if I configure the GPIO 21 that correspond to the pin 40 as output, e.g. Z direction, I get an error opening LinuxCNC.
Message:
./CNC3040.hal:78: Pin 'hal_gpio.pin-40-out' does not exist
It is enabled (GPIO 21) and configured as output of course.
There is something special with this pin I did not know?
Thanks
Bye
Andrea
it's very strange but if I configure the GPIO 21 that correspond to the pin 40 as output, e.g. Z direction, I get an error opening LinuxCNC.
Message:
./CNC3040.hal:78: Pin 'hal_gpio.pin-40-out' does not exist
It is enabled (GPIO 21) and configured as output of course.
There is something special with this pin I did not know?
Thanks
Bye
Andrea
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19113
- Thank you received: 6403
06 Mar 2022 23:31 #236541
by tommylight
Replied by tommylight on topic Raspberry: issue configuring GPIO 21 (pin 40) as output
GPIO21 should also be GPIO21 in hal. If that is the pin 40 on the header, it is still pin 21 in hal.
Not that i use much RPI, but i do not think it has 40 io pins on the header as there are 40 pins in total and some are used for power and SPI and other stuff.
Not that i use much RPI, but i do not think it has 40 io pins on the header as there are 40 pins in total and some are used for power and SPI and other stuff.
Please Log in or Create an account to join the conversation.
07 Mar 2022 07:21 #236570
by Guglielmi
Replied by Guglielmi on topic Raspberry: issue configuring GPIO 21 (pin 40) as output
Thanks for the reply, but as I wrote, (I also new using LinuxCNC and hal config, but..) what happen is that I configured GPIO 21, enabling it (removing mask) and configuring it as output, then when I linked this output to e.g. Z direction, I get the error..
In other words, now it works because I inverted two GPIO, I configured GPIO 20 as output (Z Direction) and GPIO 21 as limit switch (means input).
So.. I'm pretty sure I understood the mechanism, it's the pin 40 (GPIO 21) that doesn't want to be an output!
I'm asking why and if there is a know reason I didn't get..
In other words, now it works because I inverted two GPIO, I configured GPIO 20 as output (Z Direction) and GPIO 21 as limit switch (means input).
So.. I'm pretty sure I understood the mechanism, it's the pin 40 (GPIO 21) that doesn't want to be an output!
I'm asking why and if there is a know reason I didn't get..
Please Log in or Create an account to join the conversation.
07 Mar 2022 07:31 #236571
by Guglielmi
Replied by Guglielmi on topic Raspberry: issue configuring GPIO 21 (pin 40) as output
mmm, one doubts.. searching again on the web I found this page:
Pinout Raspberry
Now I'm confused.. one pin has 3 different numbers?
Should I use 29 in this case?
No.. It can't.. if I look the GPIO 20 it works with 38, not 28..
Pinout Raspberry
Now I'm confused.. one pin has 3 different numbers?
Should I use 29 in this case?
No.. It can't.. if I look the GPIO 20 it works with 38, not 28..
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
10 Mar 2022 22:18 #236900
by Guglielmi
Replied by Guglielmi on topic Raspberry: issue configuring GPIO 21 (pin 40) as output
Searching in this forum for another topic, I found this thread that is explaining the same issue!
forum.linuxcnc.org/24-hal-components/401...river-bug-eventually
The problem was not explained in the thread, only in the hal file attached but the workaround suggested worked also for me.
Strange the bug still since 2020..
Bye
Andrea
forum.linuxcnc.org/24-hal-components/401...river-bug-eventually
The problem was not explained in the thread, only in the hal file attached but the workaround suggested worked also for me.
Strange the bug still since 2020..
Bye
Andrea
Please Log in or Create an account to join the conversation.
15 Mar 2022 18:26 #237354
by elovalvo
Dai uno sguardo qui:
forum.linuxcnc.org/24-hal-components/401...ug-eventually#237353
Ciao
Replied by elovalvo on topic Raspberry: issue configuring GPIO 21 (pin 40) as output
Searching in this forum for another topic, I found this thread that is explaining the same issue!
forum.linuxcnc.org/24-hal-components/401...river-bug-eventually
The problem was not explained in the thread, only in the hal file attached but the workaround suggested worked also for me.
Strange the bug still since 2020..
Bye
Andrea
Dai uno sguardo qui:
forum.linuxcnc.org/24-hal-components/401...ug-eventually#237353
Ciao
Please Log in or Create an account to join the conversation.
Time to create page: 0.071 seconds