5i25 board confusion with pins directions

More
26 Oct 2017 20:53 #100857 by juanjor
Hello Folks!

I trying to configure a 5i25 from mesa with supplied PROB_RFX2 firmware.
i put in P2 4 steppers, spindle control and limits sw. configuring it with PNCconf
wizard, and all working correctly in the linuxcnc 2.7.9.

well now i try to attach a MPG unit with 4 axis selection and 3 jog overrrides, to the
free port P3, so i increment the number of encoder to 2, and i can see in the tab of P3
configuraton , the Free i/o, so i arrange as Input, the wizard generate the hal file, and
linuxcnc start correctly, , but when i see in hal configuration any pin of P3, it is show, as
output. and the logical and electric state is low (in hal file is correctly declared as input)

how i must force the needs pins as inputs? i need put the 17,18,19,20,21,22,23, encoder input 30 &31

thanks in advance any help
and sorry by my poor english

jj

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

More
26 Oct 2017 23:11 - 26 Oct 2017 23:14 #100865 by andypugh
Pins default to INPUT. You only need to change settings if they are to be outputs.

In the hal file:
setp hm2_5i25.0.gpio-17.is-output 1

linuxcnc.org/docs/2.7/html/man/man9/host...eral%20Purpose%20I/O

So it might be that you need to _delete_ some is-output commands from the HAL file.
Last edit: 26 Oct 2017 23:14 by andypugh.

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

More
27 Oct 2017 13:38 #100881 by juanjor
thanks, Andy!.
I see in the hal, but not exist a sentence declaring those pins as output....only declares as input...
I attach the hal file generated.

thanks for the help

File Attachment:

File Name: mesax7.hal
File Size:13 KB
Attachments:

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

More
27 Oct 2017 14:23 #100883 by andypugh
I think you have P2 And P3 the wrong way round, but only the names, you are right about what is where.
github.com/LinuxCNC/hostmot2-firmware/bl...ROB_RFx2_34.vhd#L109

Can you try this, to take the possibility that pncconf is wrong out of the equation.
halrun
loadrt hostmot2
loadrt hm2_pci loadrt hm2_pci config=" num_encoders=2 num_pwmgens=1 num_stepgens=4" 
exit

You should get a listing on the terminal of all the IO pins, and it _should_ have the unused stepgens and pwms as unallocated inputs.

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

More
27 Oct 2017 20:18 #100897 by juanjor
Hello Again.
Well, i make the test, the Show pin result, is attached
as I can see the Free pins @P3 is as input why with linuxcnc goes output?

This is as i see:
in terminal windows, the pin 17 is:
5 bit OUT TRUE hm2_5i25.0.gpio.017.in
5 bit OUT FALSE hm2_5i25.0.gpio.017.in_not
5 bit IN FALSE hm2_5i25.0.gpio.017.out

but under linuxcnc runnin this goes:
5 bit OUT FALSE hm2_5i25.0.gpio.017.in
5 bit OUT FALSE hm2_5i25.0.gpio.017.in_not
5 bit IN TRUE hm2_5i25.0.gpio.017.out

why?

thanks for the help!

jjr




File Attachment:

File Name: halrun_test.txt
File Size:11 KB
Attachments:

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

More
27 Oct 2017 22:24 #100900 by andypugh
Maybe you are being confused by the fact that digital input pins are HAL _output_ pins as they supply a value to HAL?

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

More
28 Oct 2017 01:25 #100903 by juanjor
No really. I confused why the,status of the pins are reverted in linuxcnc. Vs hal terninal. With the same comand. And why the pins at P3 are declared as input. But. In linuxcnc are setted as output..

Thanks by the help!

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

More
28 Oct 2017 01:42 #100904 by PCW
if the _is_output attribute is not set for a particular GPIO pin
and it is not claimed by a special function ( like a stepgen ) it is an input

Note that GPIO17 is on P2 not P3

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

More
28 Oct 2017 01:51 #100906 by andypugh

No really. I confused why the,status of the pins are reverted in linuxcnc. Vs hal terninal.


In the HAL terminal we never got as far as starting the realtime processes, so the values on the pins never got updated.

I think that you will probably find that everything is actually working perfectly well.
(You will have in, in-not and out for every GPIO pin, because at the point in time when the pins are made the system does not know if you will be using a GPIO for input or output. And in fact you can change on-the-fly. Also you can read-back the value of an output too)

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

More
28 Oct 2017 13:04 #100920 by juanjor
hello folks!

I see the post of Mr. Wallace, and i noted the fact of IO17 is in P2, but as I see the Pncconfig the generated file the
declarations are referenced to pins numbers (in the fact i can see the signals from the machine using hal configuration window
in correlation with the pin number, not Function number, i try to do the same with P3 with no luck)

the hal Declaration must be a pin or function, ej. to reference PIN 1 from P3 it must be
net joint-select-a <= hm2_5i25.0.gpio.017.in
is ok this declaration?

in any part of the hal file this pin is declared as output. but when the linux cnc is running, this goes output.
so this is my confusion, why?

thanks again.!

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

Time to create page: 0.126 seconds
Powered by Kunena Forum