HAL Driver for Raspberry PI GPIOs

More
5 years 10 months ago - 5 years 10 months ago #192548 by PCW
Right, so the hal_pi_gpio driver is pretty bare bones
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)
Last edit: 5 years 10 months ago by PCW.

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

More
5 years 10 months ago #192555 by Markyd
I think I'm just going to have to unplug the enable pins for now as i've just demonstrated to myself that I don't know what I'm doing with "not" and addf !

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

More
5 years 10 months ago #192556 by jmelson

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 or Create an account to join the conversation.

More
5 years 10 months ago #192559 by Markyd
I'd been commenting them in and out as i tried them in turn

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

More
5 years 9 months ago - 5 years 9 months ago #193932 by nion
Hello
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
_______________________________________________________
Last edit: 5 years 9 months ago by nion. Reason: Incomplete question

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

More
5 years 9 months ago #193952 by tommylight
Is the encoder wired to 7i92 or RPI?

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

Moderators: PCW, jmelson
Time to create page: 0.074 seconds
Powered by Kunena Forum