Mesa 7i92 using pins for GPIO

More
16 Aug 2016 06:34 #78823 by dannym
I have the 7i92's step/dir working on all the axes. It's using the Geckodrive G540 firmware, but actually I'm moving away from the G540 but the step/dir are all on the same pins so I don't think I need to change anything.

I've got a lot of IO to hook up soon. I was told the unused pins could be retasked as GPIO, for example P2, Pin 11 = Quad_A.

Say I want that to be a limit switch input. Does anything get done in MesaFlash, or just a HAL line?

Could I get an example of the HAL line for making an input out of P2, Pin 11?

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

More
16 Aug 2016 13:30 #78847 by PCW
Replied by PCW on topic Mesa 7i92 using pins for GPIO
Just HAL

GPIO pins will be inputs by default if not assigned to special functions outputs.
special function inputs (like encoders) are always available as GPIO inputs
If you wish to use special function inputs like encoder pins as outputs
you musty disable the encoder function in the driver command line

See the hostmot2 manual page, GPIO section

You can also list all the available pins with a

halcmd show pin

command in a terminal when linuxcnc is running

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

More
25 Aug 2016 04:03 - 25 Aug 2016 04:04 #79394 by dannym
Still using the G540 bitfile:
I have a pulldown limit switch attached to IO001 "PWM". I have correlated the other pins correctly and I'm very sure I'm on the right pin.

hm2_[HOSTMOT2](BOARD).0.gpio.001.is_output does not exist, and keeps LinuxCNC from booting if you have a setp for it.

I see gpio.001.in and in_not DO exist. So, logically, this seemed to be hardcoded to be only an input. OK.

But what I'm seeing is the input is always FALSE and in_not is always TRUE. Electrically, the pin appeared to be a driven output from the 7i92 and it is being driven LOW (thus consistent with the input=FALSE).

Did the bitfile commit this to be a special-function output, not a GPIO? The mesaflash --readhmid says its primary function IS still IOPORT.
Last edit: 25 Aug 2016 04:04 by dannym.

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

More
25 Aug 2016 09:42 #79401 by PCW
Replied by PCW on topic Mesa 7i92 using pins for GPIO
You need to disable PWMs to use that pin via a:

num_pwmgens=N token in the config string

(N=0 will disable all PWMGens)

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

More
26 Aug 2016 00:49 - 26 Aug 2016 00:52 #79453 by dannym
ok, got it
Last edit: 26 Aug 2016 00:52 by dannym.

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

Time to create page: 0.073 seconds
Powered by Kunena Forum