Square one with 5i25+7i76
Let's start with the first dumb question (I'm sure there'll be many more to come)
Setup is 5i25+single 7i76, I've used mesaflash to verify that the 5i25_7i76x2 bitfile is loaded, and after downloading mesa5i25.zip,
I now have the matching pin and xml files. I'm not convinced that pncconf is talking sense to me however.
I've figured out that I need field power on TB1, do I also need to supply power to TB3 pins 21/22 and 23/24 and should this be field power voltage?
Depending on the answer to that, I will investigate further (and no doubt ask more question)
Roger
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19190
- Thank you received: 6433
Please Log in or Create an account to join the conversation.
Open a terminal window and type
halrun
loadrt hostmot2
loadrt hm2_pci
show pin
exit
You should get a long list of HAL pins related to the 5i25. You should also get a lot of pins related to the 7i76 GPIO, if that is all connected, powered and working. These pins are likely to be of the form hm2_5i25.0.7i76.0.1.gpio......
If that all works then you can be confident that the hardware is set up correctly.
Note that PnCConf doesn't even need the hardware to be present to create a config.
In PnCConf you will probably not want to do anything at all with the 5i25 GPIO pins, look in other tabs for the 7i76 GPIO.
Please Log in or Create an account to join the conversation.
pncconf seems willing to assign all sorts of things to pins, including "digital input 0 thru 3" and "digital output 0 thru 3" which I don't find documented anywhere, but it absolutely will not set mode=2 in the output hal file. I have to edit it in every time. Is this a known problem with pncconf, or what am I not doing?
Roger
Please Log in or Create an account to join the conversation.
Sorry, interrupt from real life has kept me away for a couple of days.
pncconf seems willing to assign all sorts of things to pins, including "digital input 0 thru 3" and "digital output 0 thru 3" which I don't find documented anywhere,
Those are inputs/outputs from G-code:
linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m62-m65
but it absolutely will not set mode=2 in the output hal file. I have to edit it in every time. Is this a known problem with pncconf, or what am I not doing?
Roger
I think it is a missing feature in PnCConf. The underlying achitecture of the config too pre-dates the smart-serial cards. when they arrived they really complicated matters.
Please Log in or Create an account to join the conversation.
it just seems to forget to write it out to the hal file, and if you forget to edit it back in then linuxcnc starts puking error messages about undefined pins. So maybe it's a simple fix in the source of PnCConf, but I'm surprised nobody seems to have noticed it or mentioned it before now.
Thanks for the pointer to the m-code docs, another little piece begins to make sense.
So tonight I dive a little deeper down the rabbit hole.
Roger
Please Log in or Create an account to join the conversation.
I could be wrong here, python isn't really my thing, and the author knows more about it's internals than I ever will (or want to) but maybe thats enough information to get somebody wiser than I looking.
If it's what I think it is, then the fix should be two or three lines.
Roger
Please Log in or Create an account to join the conversation.
if self.d.mesa0_numof_sserialports:
for i in range(1,_PD._NUM_CHANNELS+1):
if i <= self.d.mesa0_numof_sserialchannels:
for j in ("123456789#"):
if ("m"+j) in self.d["mesa0sserial0_%dsubboard"% (i-1)]:
temp = temp + j
break
if j == "#":
temp = temp + "0"
else:
temp = temp + "x"
ssconfig0 = " sserial_port_0=%s"% temp
If it does, I will push it as a fix.
(I don't actually know where you found a place to set the 7i76 mode, which is why I haven't actually tested it, but it seemed to work with a fictional 7i84)
Please Log in or Create an account to join the conversation.
Now I'm off to make a backup of pncconf.py and try your patch.
Roger
Please Log in or Create an account to join the conversation.
Here is the diff between pncconf.bak (the original) and the edited pncconf
5471,5475c5471,5476
< # if m1 in the name then it needs mode 1
< if "m1" in self.d["mesa0sserial0_%dsubboard"% (i-1)]:
< temp = temp + "1"
< else:
< temp = temp + "0"
---
> for j in ("123456789#"):
> if ("m"+j) in self.d["mesa0sserial0_%dsubboard"% (i-1)]:
> temp = temp + j
> break
> if j =="#":
> temp = temp + "0"
Roger
P.S.
Localising this problem wasn't down to advanced voodoo debugging techniques, it was more a matter of once I had found how to set mode=2 for the 7i76 all the option boxes made sense, I could set all the things I expected to be able to set and everything seemed o.k. except that pncconf wouldn't write the correct line containing the mode 2.
SO I had a "what if" moment and checked whether it was actually writing it out to the hal file ..... and lo and behold it seems it wasn't.
Score one for dumb luck.
Please Log in or Create an account to join the conversation.