- Posts: 75
- Thank you received: 0
HAL Driver for Raspberry PI GPIOs
#setp hal_pi_gpio.pin-29-invert true
#setp hal_pi_gpio.pin-29-out-invert true
#setp hal_pi_gpio.pin-29.invert true
#setp hal_pi_gpio.pin-29.invert-output true
#setp hal_pi_gpio.pin-29.invert_output true
#setp hal_pi_gpio.pin-29-out.invert-output TRUE
#setp hal_pi_gpio.pin-29-out.invert_output TRUE
net xenable => hal_pi_gpio.pin-29-out
Please Log in to join the conversation.
halcmd show all hal_pi
Please Log in to join the conversation.
pi@linuxcnc:~ $ halcmd show all hal_pi
Loaded HAL Components:
ID Type Name PID State
31 RT hal_pi_gpio ready
Component Pins:
Owner Type Dir Value Name
31 bit OUT FALSE hal_pi_gpio.pin-03-in ==> limit-z-switch
31 bit OUT FALSE hal_pi_gpio.pin-11-in
31 bit OUT FALSE hal_pi_gpio.pin-12-in
31 bit OUT FALSE hal_pi_gpio.pin-13-in ==> limit-x-switch
31 bit IN FALSE hal_pi_gpio.pin-15-out
31 bit OUT FALSE hal_pi_gpio.pin-16-in ==> limit-y-switch
31 bit OUT FALSE hal_pi_gpio.pin-18-in ==> not-1-in
31 bit IN FALSE hal_pi_gpio.pin-19-out <== ydir
31 bit IN FALSE hal_pi_gpio.pin-21-out
31 bit IN FALSE hal_pi_gpio.pin-22-out
31 bit IN FALSE hal_pi_gpio.pin-23-out <== ystep
31 bit IN FALSE hal_pi_gpio.pin-24-out <== xdir
31 bit IN FALSE hal_pi_gpio.pin-26-out <== spindle-on
31 bit IN FALSE hal_pi_gpio.pin-29-out <== xenable
31 bit IN FALSE hal_pi_gpio.pin-31-out
31 bit IN FALSE hal_pi_gpio.pin-32-out <== xstep
31 bit IN FALSE hal_pi_gpio.pin-33-out
31 bit IN FALSE hal_pi_gpio.pin-35-out
31 bit IN FALSE hal_pi_gpio.pin-36-out <== zstep
31 bit IN FALSE hal_pi_gpio.pin-37-out
31 bit IN FALSE hal_pi_gpio.pin-38-out
31 bit IN FALSE hal_pi_gpio.pin-40-out <== zdir
31 s32 OUT 1093 hal_pi_gpio.read.time
31 s32 OUT 833 hal_pi_gpio.write.time
Please Log in to join the conversation.
Please Log in to join the conversation.
and doesn't have invert capability on inputs or outputs
(the pin/parameter listing would show these if the driver provided them)
You could use the hal "not" component to invert the desired signals
(or bug the hal_pi_gpio writer to add invert capability)
Please Log in to join the conversation.
Please Log in to join the conversation.
Markyd wrote: still no luck, regardless of what syntax i use. I've tried all the variations below without success. I've even tried the xdir pin but the result is the same. Does the hal_pi_gpio accept invert?
#setp hal_pi_gpio.pin-29-invert true
The # at the beginning makes the line a comment. Did you actually have the # as the first character on the line?
If so, try without the #.
Jon
Please Log in to join the conversation.
Please Log in to join the conversation.
I'm using RPI4 with 7i92 for the moment but I want to add one encoder for feed override using the RPI GPIO driver.
This is what I added to my hal file but I don't get reading on Hal Meter hal_pi_gpio.pin-03-in and hal_pi_gpio.pin-05-in. I also tried different pins with no success.
Can someone please point me what I'm doing wrong
loadrt hal_pi_gpio dir=67108860 exclude=0
loadrt encoder num_chan=1
addf encoder.capture-position servo-thread
addf encoder.update-counters servo-thread
setp halui.feed-override.scale .005
net feedcount halui.feed-override.counts <= encoder.0.counts
net feedup encoder.0.phase-A <= hal_pi_gpio.pin-03-in
net feeddown encoder.0.phase-B <= hal_pi_gpio.pin-05-in
_______________________________________________________
pi@linuxcnc:~ $ halcmd show all hal_pi
Component Pins:
Owner Type Dir Value Name
29 bit OUT FALSE hal_pi_gpio.pin-03-in ==> feedup
29 bit OUT FALSE hal_pi_gpio.pin-05-in ==> feeddown
29 bit IN FALSE hal_pi_gpio.pin-07-out
29 bit IN FALSE hal_pi_gpio.pin-08-out
29 bit IN FALSE hal_pi_gpio.pin-10-out
29 bit IN FALSE hal_pi_gpio.pin-11-out
29 bit IN FALSE hal_pi_gpio.pin-12-out
29 bit IN FALSE hal_pi_gpio.pin-13-out
29 bit IN FALSE hal_pi_gpio.pin-15-out
29 bit IN FALSE hal_pi_gpio.pin-16-out
29 bit IN FALSE hal_pi_gpio.pin-18-out
29 bit IN FALSE hal_pi_gpio.pin-19-out
29 bit IN FALSE hal_pi_gpio.pin-21-out
29 bit IN FALSE hal_pi_gpio.pin-22-out
29 bit IN FALSE hal_pi_gpio.pin-23-out
29 bit IN FALSE hal_pi_gpio.pin-24-out
29 bit IN FALSE hal_pi_gpio.pin-26-out
29 bit IN FALSE hal_pi_gpio.pin-29-out
29 bit IN FALSE hal_pi_gpio.pin-31-out
29 bit IN FALSE hal_pi_gpio.pin-32-out
29 bit IN FALSE hal_pi_gpio.pin-33-out
29 bit IN FALSE hal_pi_gpio.pin-35-out
29 bit IN FALSE hal_pi_gpio.pin-36-out
29 bit IN FALSE hal_pi_gpio.pin-37-out
29 bit IN FALSE hal_pi_gpio.pin-38-out
29 bit IN FALSE hal_pi_gpio.pin-40-out
29 s32 OUT 0 hal_pi_gpio.read.time
29 s32 OUT 0 hal_pi_gpio.write.time
_______________________________________________________
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
- Posts: 22010
- Thank you received: 3
Please Log in to join the conversation.
