HAL Driver for Raspberry PI GPIOs

More
5 years 10 months ago #192530 by tommylight
Try
setp hal_pi_gpio.pin-29.invert_output TRUE
And show us the error, otherwise we can just guess.

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

More
5 years 10 months ago - 5 years 10 months ago #192532 by Markyd
This is the error. I assume the relevant bit is "parameter or pin 'hal_pi_gpio.pin-29.invert_output' not found". I've tried lots of variations and no luck
Code:
Error report created by /usr/lib/tcltk/linuxcnc/show_errors.tcl: Print file information: RUN_IN_PLACE=no LINUXCNC_DIR= LINUXCNC_BIN_DIR=/usr/bin LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc LINUXCNC_SCRIPT_DIR= LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules LINUXCNC_CONFIG_DIR= LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs INIVAR=inivar HALCMD=halcmd LINUXCNC_EMCSH=/usr/bin/wish8.6 LINUXCNC - 2.8.0 Machine configuration directory is '/home/pi/linuxcnc/configs/Harrison_Vert_Mill' Machine configuration file is 'Harrison_Vert_Mill.ini' INIFILE=/home/pi/linuxcnc/configs/Harrison_Vert_Mill/Harrison_Vert_Mill.ini VERSION=1.1 PARAMETER_FILE=linuxcnc.var TASK=milltask HALUI=halui DISPLAY=axis COORDINATES=X Y Z KINEMATICS=trivkins Starting LinuxCNC... Starting LinuxCNC server program: linuxcncsvr Loading Real Time OS, RTAPI, and HAL_LIB modules Starting LinuxCNC IO program: io Starting HAL User Interface program: halui twopass:invoked with <> options twopass:found ./Harrison_Vert_Mill.hal twopass:found ./custom.hal twopass:pass0: loadusr -W hal_manualtoolchange twopass: Error in file ./Harrison_Vert_Mill.hal: setting parameter 'hal_pi_gpio.pin-29.invert_output' to 'TRUE' parameter or pin 'hal_pi_gpio.pin-29.invert_output' not found Shutting down and cleaning up LinuxCNC... Removing HAL_LIB, RTAPI, and Real Time OS modules Removing NML shared memory segments Debug file information: Note: Using POSIX realtime 3852 Stopping realtime threads Unloading hal components Note: Using POSIX realtime


And this is how it appears in the HAL file
Code:
setp hal_pi_gpio.pin-29.invert_output TRUE net xenable => hal_pi_gpio.pin-29-out net xstep stepgen.0.step => hal_pi_gpio.pin-32-out net ystep stepgen.1.step => hal_pi_gpio.pin-23-out net zstep stepgen.2.step => hal_pi_gpio.pin-36-out # i use GPIO 14,15,18 for xdir ydir zdir, thats rpin net xdir stepgen.0.dir => hal_pi_gpio.pin-24-out net ydir stepgen.1.dir => hal_pi_gpio.pin-19-out net zdir stepgen.2.dir => hal_pi_gpio.pin-40-out
Last edit: 5 years 10 months ago by Markyd.

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

More
5 years 10 months ago #192542 by Markyd
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
#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 or Create an account to join the conversation.

More
5 years 10 months ago #192543 by PCW
Rather than guessing, why don't you look at all available pins/parameters?

halcmd show all hal_pi

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

More
5 years 10 months ago - 5 years 10 months ago #192546 by Markyd
I'm new to linuxcnc so the 'obvious' isn't yet obvious to me, so thanks for the suggestion. I get the following, which seems to recognise "hal_pi_gpio.pin-29-out <== xenable" but says Dir is "IN" which i don't understand ??



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
Last edit: 5 years 10 months ago by Markyd.

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

More
5 years 10 months ago #192547 by Markyd
There is no mention of the word "Invert" in github.com/LinuxCNC/linuxcnc/blob/master...rivers/hal_pi_gpio.c , is that likely to be significant ?

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

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