7i92 outputs not responding

More
06 Mar 2020 17:46 #159341 by xunil
Hi folks, I have a 7i92 connected to a plasma cutter table I've built. The 7i92 has the G540x2 bitfile loaded, but I have most of the accessories turned off on the second connector (P1), as I'm using these pins mostly as GPIOs for things like limit switches and ohmic probing.

Motion control is working great, and inputs seem to work fine - the limit switches work for homing, the ohmic probing correctly senses when it closes the circuit with the material. The GPIO outputs, however, don't seem to allow me to change state, they are stuck outputting a logic level high (~4.975V).

In an attempt to debug this, I've created a barebones HAL configuration which is just loading hm2_eth and the bare minimum of other components to support it. I've loaded this using halrun, and attempted to toggle GPIO pins using setp:
loadrt trivkins coordinates=XYZ kinstype=BOTH
loadrt motmod servo_period_nsec=1000000 num_joints=3 num_spindles=1
loadrt hostmot2

loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=2 num_stepgens=3 num_pwmgens=0"

setp hm2_7i92.0.watchdog.timeout_ns 25000000
addf hm2_7i92.0.read         servo-thread
addf hm2_7i92.0.write        servo-thread
setp hm2_7i92.0.dpll.01.timer-us -50
setp hm2_7i92.0.stepgen.timer-number 1

But, all to no avail. The outputs stay stubbornly at logic high according to a DMM connected to the relevant pins. Interestingly, halmeter shows the pins changing! I tried playing with the is_output and is_opendrain pins too, but they didn't seem to make any difference.

I've attached a capture of my halrun session.

File Attachment:

File Name: halrun.txt
File Size:8 KB


Am I missing something with how to configure the GPIO pins? Is this because I've turned off most of the components, do I need a different bitfile to use part of P1's pins as outputs?

Any and all suggestions and ideas greatly appreciated. Thanks!
-Rob
Attachments:

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

More
06 Mar 2020 18:07 - 09 Mar 2020 00:43 #159344 by BeagleBrainz
setp & getp are used for parameters
set & get are for pins

I used to mix them up ;)


Good luck

Take no notice.......stupid me didn't RTFM properly :blush:
Last edit: 09 Mar 2020 00:43 by BeagleBrainz.

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

More
06 Mar 2020 18:08 #159345 by PCW
Replied by PCW on topic 7i92 outputs not responding
Nothing in your test file sets any second port bit to output mode

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

More
06 Mar 2020 18:15 #159346 by xunil
Replied by xunil on topic 7i92 outputs not responding
I really hope it's that simple! I'll try today and report back.

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

More
06 Mar 2020 18:16 #159347 by xunil
Replied by xunil on topic 7i92 outputs not responding

Nothing in your test file sets any second port bit to output mode


Do you mean because I'm using setp and not set, as mentioned above? Or something else? How would I set a pin to output mode, was I on the right track with setting is_output to TRUE?

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

More
06 Mar 2020 18:27 - 06 Mar 2020 18:29 #159348 by PCW
Replied by PCW on topic 7i92 outputs not responding
Yes, any GPIO pin that needs to be an output must be explicitly set to output mode:

setp hm2_7i92.0.gpio.024.is_output true
Last edit: 06 Mar 2020 18:29 by PCW.

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

More
06 Mar 2020 19:08 #159349 by xunil
Replied by xunil on topic 7i92 outputs not responding
I'm glad this appears to be such a simple solution. I will give this a try this afternoon. Thanks!

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

More
07 Mar 2020 07:50 #159378 by xunil
Replied by xunil on topic 7i92 outputs not responding
Unsurprisingly, this was definitely the problem. Thanks all!

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

More
08 Mar 2020 23:54 #159532 by andypugh

setp & getp are used for parameters
set & get are for pins


That's not actually true.
The following user(s) said Thank You: BeagleBrainz

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

More
09 Mar 2020 00:36 - 09 Mar 2020 00:42 #159540 by BeagleBrainz
oh ok...my bad, thanks :)

Could explain it a bit further, I misunderstood the docs.


I RTFM properly....now I get it.
Once again thanks for pointing that out.
Last edit: 09 Mar 2020 00:42 by BeagleBrainz.

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

Moderators: PCWjmelson
Time to create page: 0.293 seconds
Powered by Kunena Forum