Mesa 7i76eu output_sink and output_source confusion
- garmanarnar
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
11 Mar 2026 13:10 #344135
by garmanarnar
Mesa 7i76eu output_sink and output_source confusion was created by garmanarnar
Hello all, I am trying to configure `output_sink` and `output_source` pins for my Mesa 7i76eu and I am running into some surprising behavior. My goal is to put `hm2_7i76e.0.7i76.0.0.output-11` into sink mode.
Long story short, putting `setp hm2_7i76e.0.7i76.0.0.output_source 0x0000F7FF` and `setp hm2_7i76e.0.7i76.0.0.output_sink 0x00000800` in my HAL file after loading `hm2_eth` does not seem to have any effect, output-11 remains in sourcing mode. I spent some time debugging this and found some surprising results.
The first thing I did was attempt to setup the pins manually without changing anything in my HAL file. For this test, my HAL file did not set `output_sink` or `output_source` at all. On a fresh power cycle of both my computer and the mesa card, the following works correctly (causes output-11 to sink when TRUE).
```
halcmd setp hm2_7i76e.0.7i76.0.0.output_source 0x0000F7FF
halcmd setp hm2_7i76e.0.7i76.0.0.output_sink 0x00000800
halcmd setp hm2_7i76e.0.7i76.0.0.output-11 TRUE
```
I can toggle output-11 back and forth between TRUE and FALSE and it appears to work just fine. The strange part is that if I set output_source = 0x0000FFFF output_sink = 0x00000000 (going back to the default value), `output-11` remains in sinking mode, it does not switch back to sourcing mode. The only way I can get it to switch back is if I power cycle the Mesa card.
The second thing I tried was setting `hm2_7i76e.0.7i76.0.0.output_source 0x0000F7FF` and `setp hm2_7i76e.0.7i76.0.0.output_sink 0x00000800` as part of my postgui HAL, the thinking being that maybe there is some timing issue for when you configure the output pin modes. This does seem to work as long as I do a power cycle of the Mesa card and computer, but it feels like a bit of a hack.
I'm using this setup to control activation of a wireless probe receiver which needs `output-11` to sink to ground in order to activate the probe, so my main worry is that I'm just hiding a timing related issue by doing this in postgui and will end up running into a crash down the line. If anyone has some insight into how `output_source` and `output_sink` are supposed to work, that would be appreciated!
Thanks!
Long story short, putting `setp hm2_7i76e.0.7i76.0.0.output_source 0x0000F7FF` and `setp hm2_7i76e.0.7i76.0.0.output_sink 0x00000800` in my HAL file after loading `hm2_eth` does not seem to have any effect, output-11 remains in sourcing mode. I spent some time debugging this and found some surprising results.
The first thing I did was attempt to setup the pins manually without changing anything in my HAL file. For this test, my HAL file did not set `output_sink` or `output_source` at all. On a fresh power cycle of both my computer and the mesa card, the following works correctly (causes output-11 to sink when TRUE).
```
halcmd setp hm2_7i76e.0.7i76.0.0.output_source 0x0000F7FF
halcmd setp hm2_7i76e.0.7i76.0.0.output_sink 0x00000800
halcmd setp hm2_7i76e.0.7i76.0.0.output-11 TRUE
```
I can toggle output-11 back and forth between TRUE and FALSE and it appears to work just fine. The strange part is that if I set output_source = 0x0000FFFF output_sink = 0x00000000 (going back to the default value), `output-11` remains in sinking mode, it does not switch back to sourcing mode. The only way I can get it to switch back is if I power cycle the Mesa card.
The second thing I tried was setting `hm2_7i76e.0.7i76.0.0.output_source 0x0000F7FF` and `setp hm2_7i76e.0.7i76.0.0.output_sink 0x00000800` as part of my postgui HAL, the thinking being that maybe there is some timing issue for when you configure the output pin modes. This does seem to work as long as I do a power cycle of the Mesa card and computer, but it feels like a bit of a hack.
I'm using this setup to control activation of a wireless probe receiver which needs `output-11` to sink to ground in order to activate the probe, so my main worry is that I'm just hiding a timing related issue by doing this in postgui and will end up running into a crash down the line. If anyone has some insight into how `output_source` and `output_sink` are supposed to work, that would be appreciated!
Thanks!
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 17820
- Thank you received: 5213
11 Mar 2026 17:37 - 11 Mar 2026 18:54 #344142
by PCW
Replied by PCW on topic Mesa 7i76eu output_sink and output_source confusion
Unlike sserial pins, you can only "setp" sserial parameters (like the source and sink masks) in LinuxCNCs hal file,
they cannot be changed dynamically. This is true of all sserial parameters, that is, they are only updated on driver startup.
The output modes are something typically set to match the interfaced hardware, so do not need to be changed dynamically.
they cannot be changed dynamically. This is true of all sserial parameters, that is, they are only updated on driver startup.
The output modes are something typically set to match the interfaced hardware, so do not need to be changed dynamically.
Last edit: 11 Mar 2026 18:54 by PCW.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- garmanarnar
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
11 Mar 2026 19:13 #344150
by garmanarnar
Replied by garmanarnar on topic Mesa 7i76eu output_sink and output_source confusion
Thanks for the reply PCW. The issue I'm running into is that it seems the source/sink masks are only "settable" in my postgui HAL file, which runs after the HAL and GUI start up.
If I move the setp commands to set the masks into my main HAL file, either near the top or last, they don't seem to take effect despite "getp" showing them as being set. I can't put the masked pin into the proper mode (sinking in my case).
When I put them in my postgui HAL, or manually set them with setp after linuxcnc startup, it works just fine.
I'm just wondering if there is some timing constraint when it comes to setting these masks that launching the GUI is covering up.
Thanks
If I move the setp commands to set the masks into my main HAL file, either near the top or last, they don't seem to take effect despite "getp" showing them as being set. I can't put the masked pin into the proper mode (sinking in my case).
When I put them in my postgui HAL, or manually set them with setp after linuxcnc startup, it works just fine.
I'm just wondering if there is some timing constraint when it comes to setting these masks that launching the GUI is covering up.
Thanks
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 17820
- Thank you received: 5213
11 Mar 2026 19:17 #344151
by PCW
Replied by PCW on topic Mesa 7i76eu output_sink and output_source confusion
There is no timing issue but they are only settable in the hal file (that is they are only set when the driver loads),
it may be that the way the hal file parsing order works means that they must be in the postgui hal file
it may be that the way the hal file parsing order works means that they must be in the postgui hal file
The following user(s) said Thank You: garmanarnar
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.078 seconds