7i85s differential Outputs as drive enables

More
3 years 1 month ago #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
3 years 1 month ago - 3 years 1 month ago #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: 3 years 1 month ago by PCW.

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

More
3 years 1 month ago #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.

 

Your browser does not support embedded PDFs. Please download the file here: Download PDF.







 

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

More
3 years 1 month ago #281836 by PCW
Did you set the pin to output mode?

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

More
3 years 1 month ago #281893 by Doug Crews
Got it!  I needed to switch to GPIO 005 (TX5) and invert it.  

Pin 5 (TX5) is low when Lcnc is not running, Inverting it makes it low when lcnc is running but not enabled, and finally high when enabled.

The graphic shows the relationship between the Pin names, Pin parameters and  7i85s terminal block association.

Peter, thank you for pointing me in the right direction, and not just doing it for me.   This has been a very worth while and desperately needed hal / hostmot2 education for me.

 

Your browser does not support embedded PDFs. Please download the file here: Download PDF.


 

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

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