7i85s differential Outputs as drive enables

More
24 Sep 2023 00:30 #281520 by Doug Crews
Hi everyone,

The Spec sheet for the 7i85s states the "differential outputs can be used individually for interfacing single ended loads" and "When 7I85S outputs are used for drive enables or other safety related controls it is very important that the startup state disables the external equipment."

If I want to use an unused PWM TXN pin as a 5V sourcing output to enable a drive would I need to change the firmware on the 7i92T FPGA board,  or is there already a hal pin that references it that I need to find and then map to it?thanks
Doug

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

More
24 Sep 2023 17:42 #281554 by tommylight
Probably not, it should work as is if not designated a primary function.
Since i never used 7i85S, i am moving this to "driver boards", PCW knows everything about Mesa.
The following user(s) said Thank You: Doug Crews

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

More
25 Sep 2023 02:31 #281571 by PCW
If you disable the PWM channel that drives the pin
( by setting num_pwms appropriately ), you can access the
pin as GPIO.

You also need to choose the connections and GPIO polarity
so that the drive is disabled when LinuxCNC is not running
 

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

More
27 Sep 2023 00:45 #281684 by Doug Crews
Hi Peter, Thanks for the reassurance,  and as usual all this information is in the Hostmot2 documentation.  Could you confirm my process is ok.  I made graphic of how I think this works.

1. 7i92t is flashed with 4 PWMGen modules via the bit file.
2. During l.cnc startup the loadrt config string in the hal file loads how many pwmgen modules you actually want to use.  If I say num_pwmgen = 2  then the remaining 2 pwmgen module pins will be converted to GPIO pins.  
3.  With l.cnc running enter " halcmd show all hm2 "  in terminal to show gpio name associations.
 4. I then use the gpio names for mapping to other pins in the hal file and they get physically wired to the 7i85s TB pin according the 7i85s layout.

 

This browser does not support PDFs. Please download the PDF to view it: Download PDF


 
Attachments:

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

More
27 Sep 2023 14:17 #281720 by PCW
That's correct.

A bit easier way to show the GPIO to terminal mapping is by using
a daughterboard specific pin list, like:

mesaflash --device 7i92t --addr 10.10.10.10 --dbname1 7i85s --readhmid
The following user(s) said Thank You: Doug Crews

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

More
28 Sep 2023 03:02 #281763 by Doug Crews
HI Peter,  I'm still going to need some more hand holding.   I'm trying to use one of the unused PWM pins as an enable,

 I get load time error "load erroor./ROBO_WELD_1.hal:113: Pin 'hm2_7i92.0.gpio.004.invert_output' does not exist
3178"

the line with error
hal file line 113  -->      net y-enable     joint.1.amp-enable-out  => hm2_7i92.0.pwmgen.01.enable => hm2_7i92.0.gpio.004.invert_output

the config strig
loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=4 num_pwmgens=2 num_stepgens=0 sserial_port_0=000001"

I tried to set the _invert_output to True but still same error.    I tried to follow my procedure above, but I think I'm still lacking some basic hal mapping skills.  Or I have a syntax problem I cannot spot.

-Doug





 

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

More
28 Sep 2023 03:32 #281765 by PCW
It works for me with a quick test:
halcmd -kf
halcmd: loadrt hostmot2
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
halcmd: loadrt hm2_eth board_ip=10.10.10.10 config="num_pwmgens=2"
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 10.10.10.10: INFO: Hardware address (MAC): 00:60:1b:12:80:00
hm2_eth: discovered 7I92T
hm2/hm2_7i92.0: Low Level init 0.15
hm2/hm2_7i92.0: Smart Serial Firmware Version 43
hm2/hm2_7i92.0: 34 I/O Pins used:
hm2/hm2_7i92.0:     IO Pin 000 (P2-01): IOPort
hm2/hm2_7i92.0:     IO Pin 001 (P2-14): IOPort
hm2/hm2_7i92.0:     IO Pin 002 (P2-02): IOPort
hm2/hm2_7i92.0:     IO Pin 003 (P2-15): IOPort
hm2/hm2_7i92.0:     IO Pin 004 (P2-03): IOPort
hm2/hm2_7i92.0:     IO Pin 005 (P2-16): IOPort
hm2/hm2_7i92.0:     IO Pin 006 (P2-04): PWMGen #1, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i92.0:     IO Pin 007 (P2-17): PWMGen #1, pin Out1 (Dir or Down) (Output)
hm2/hm2_7i92.0:     IO Pin 008 (P2-05): PWMGen #0, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i92.0:     IO Pin 009 (P2-06): PWMGen #0, pin Out1 (Dir or Down) (Output)
SNIP
halcmd: loadrt threads
halcmd: addf hm2_7i92.0.read thread1
halcmd: addf hm2_7i92.0.write thread1
halcmd: start
halcmd: setp hm2_7i92.0.gpio.004.is_output true
halcmd: setp hm2_7i92.0.gpio.004.invert_output true
halcmd: setp hm2_7i92.0.gpio.004.out true
halcmd: getp hm2_7i92.0.gpio.004.in
FALSE
halcmd: setp hm2_7i92.0.gpio.004.out false
halcmd: getp hm2_7i92.0.gpio.004.in
TRUE


 

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

More
28 Sep 2023 20:31 - 28 Sep 2023 20:34 #281815 by PCW
the line with error
hal file line 113  -->      net y-enable     joint.1.amp-enable-out  => hm2_7i92.0.pwmgen.01.enable => hm2_7i92.0.gpio.004.invert_output


Sorry I did not notice this, You are trying to "net" a parameter
(hm2_7i92.0.gpio.004.invert_output) and that does not work.

It's likely you want:

net y-enable     joint.1.amp-enable-out  => hm2_7i92.0.pwmgen.01.enable => hm2_7i92.0.gpio.004.out

and possibly:

setp hm2_7i92.0.gpio.004.invert_output true
 
Last edit: 28 Sep 2023 20:34 by PCW.

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

More
29 Sep 2023 04:11 #281832 by Doug Crews
Thanks Peter, and yes this is a hal tutorial, sorry.   I updated the hal file per your suggestion.   L.cnc loads and the y-enable is showing mapped to gpio pin 004, .  however the status of gpio 004 does not change when I push the enable button, and I do not read 5v across pins 2&3 on TB1 when enabled.

There is probably another fundamental hal mapping rule that I am ignorant of,  or there is something with the direction.  The pin is labeled as "out" but the hal config  direction lists it as "IN" and there is the "invert_output" associated with the pin name, plenty of room there for a misdirection at my current knowledge level.

 

This browser does not support PDFs. Please download the PDF to view it: Download PDF







 
Attachments:

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

More
29 Sep 2023 05:04 #281836 by PCW
Did you set the pin to output mode?

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

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