Trying to add 7C81 to pncconf
- gene_weber
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 6
09 Jul 2023 22:29 #275097
by gene_weber
Trying to add 7C81 to pncconf was created by gene_weber
I'm still low enough on the learning curve to find HAL totally confusing. So I was wishing that pncconf had contained the 7c81 information. I found a thread about how to add a MESA card which led me to this document in the github repository.
Great document. Only two things I didn't understand. 1) What are "discovered sserial devices"? 2) I just don't understand this paragraph at all. What logical number?
Using this document and the pin file generated based on the default firmware loaded into the 7c81 I edited /usr/lib/python3/dist-packages/pncconf/private_data.py after making a backup copy.
In the pin file, all pins list the primary function as IOPORT. So I used the secondary functions. I don't know if that is correct. Here is what was added in the MESA_INTERNAL_FIRMWAREDATA section.
This was added in the MESA_BOARD_META section.
I called this a 5ABOBX1 because it doesn't match the 5ABOBX2 or 5ABOBX3 pin files.
It almost works, but not quite. It gets to the "Mesa Card 0" screen, and you can select the card and firmware. I only need a PWM for spindle speed, so I reduced Num of pwm generators to 1. It's a 3 axis mill, so I reduced Num of step generators to 3. But Accept component Changes has an error. It has this same error even if I don't reduce any counts.
Something I added is causing an index to go out of range, but I'm not sure what exactly.
I'd greatly appreciate any and all review of this as I may have made multiple mistakes.
Best,
Gene
Great document. Only two things I didn't understand. 1) What are "discovered sserial devices"? 2) I just don't understand this paragraph at all. What logical number?
If logical number < 100 => GPIO can be changed to GPIOO or GPIOD at the start of linuxcnc, load time if you prefer (or run time) If logical number > 100 => GPIO can NOT be changed to GPIOO or GPIOD at the start of linuxcnc, load time (always input or always output) Value of number or number-100 corresponds with HAL Pin of Hostmot2 component The number 0 or 100 currently only has meaning for GPIO, SSR, INM and OUTM components. With GPIO the numbering uses the position in the firmware, starting with the first found GPIO as 0. SSR encodes the logical number within the 1xx number. ie 100 = zero component, 101 the #1 component etc.
Using this document and the pin file generated based on the default firmware loaded into the 7c81 I edited /usr/lib/python3/dist-packages/pncconf/private_data.py after making a backup copy.
In the pin file, all pins list the primary function as IOPORT. So I used the secondary functions. I don't know if that is correct. Here is what was added in the MESA_INTERNAL_FIRMWAREDATA section.
# 7c81 #################### ['7c81-Internal Data', 'MESA7C81', '5ABOBX1', '7c81', 'hm2_rpspi', 1,3, 0,0, 3,1, 0,0, 10,2, 1,2, [],0,0,0,0,0,0,0, 1, 57, 100, 200, [1,2,7], # TAB 1 [S.PWMP,0],[S.NUSED,0],[S.STEPA,0],[S.NUSED,0],[S.STEPB,0],[S.NUSED,0],[S.STEPA,1],[S.NUSED,0],[S.STEPB,1],[S.STEPA,2], [S.STEPB,2],[S.STEPA,3],[S.STEPB,3],[S.NUSED,0],[S.ENCA,0],[S.ENCB,0],[S.ENCI,0],[S.TXDATA0,0], # TAB 2 [S.PWMP,1],[S.NUSED,0],[S.STEPA,4],[S.NUSED,0],[S.STEPB,4],[S.NUSED,0],[S.STEPA,5],[S.NUSED,0],[S.STEPB,5],[S.STEPA,6], [S.STEPB,6],[S.NUSED,0],[S.NUSED,0],[S.NUSED,0],[S.NUSED,0],[S.NUSED,0],[S.NUSED,0],[S.TXDATA1,0],[S.TXEN0,0],[S.TXEN1,0], # TAB 7 [S.PWMP,2],[S.NUSED,0],[S.STEPA,7],[S.NUSED,0],[S.STEPB,7],[S.NUSED,0],[S.STEPA,8],[S.NUSED,0],[S.STEPB,8],[S.STEPA,9], [S.STEPB,9],[S.NUSED,0],[S.NUSED,0],[S.NUSED,0],[S.NUSED,0],[S.NUSED,0],[S.NUSED,0],[S.RXDATA0,0],[S.RXDATA1,0],],
This was added in the MESA_BOARD_META section.
'7c81':{'DRIVER':'hm2_rpspi','PINS_PER_CONNECTOR':19,'TOTAL_CONNECTORS':3,'TAB_NUMS':[1,2,3],'TAB_NAMES':['P1/P5/P6','P2/P5/P6','P7/P5/P6']},
I called this a 5ABOBX1 because it doesn't match the 5ABOBX2 or 5ABOBX3 pin files.
It almost works, but not quite. It gets to the "Mesa Card 0" screen, and you can select the card and firmware. I only need a PWM for spindle speed, so I reduced Num of pwm generators to 1. It's a 3 axis mill, so I reduced Num of step generators to 3. But Accept component Changes has an error. It has this same error even if I don't reduce any counts.
Something I added is causing an index to go out of range, but I'm not sure what exactly.
I'd greatly appreciate any and all review of this as I may have made multiple mistakes.
Best,
Gene
Please Log in or Create an account to join the conversation.
- gene_weber
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 6
09 Jul 2023 22:34 #275100
by gene_weber
Replied by gene_weber on topic Trying to add 7C81 to pncconf
I'm hoping this is an easier to read version of the MESA_INTERNAL_FIRMWAREDATA text.
Attachments:
Please Log in or Create an account to join the conversation.
- gene_weber
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 6
11 Jul 2023 22:13 #275241
by gene_weber
Replied by gene_weber on topic Trying to add 7C81 to pncconf
OK, I figured out the "index out of range" error. To paraphrase Monty Python "Then, shalt thou count to three 24. No more. No less. Three 24 shalt be the number thou shalt count, and the number of the counting shall be three 24. Four shalt thou not count, nor either count thou two, excepting that thou then proceed to three 24. Five is right out."
I hadn't understood the difference between calling a pin a GPIO or NUSED. NUSED means fake. If there are less the 24 pins you have to add fake pins till the array of pins equals 24.
Here is the new MESA_INTERNAL_FIRMWAREDATA text.
I also tweaked the line in the MESA_BOARD_META section.
This seems to work correctly. Would still appreciate any additional information or feedback.
Thanks,
Gene
I hadn't understood the difference between calling a pin a GPIO or NUSED. NUSED means fake. If there are less the 24 pins you have to add fake pins till the array of pins equals 24.
Here is the new MESA_INTERNAL_FIRMWAREDATA text.
I also tweaked the line in the MESA_BOARD_META section.
'7c81':{'DRIVER':'hm2_rpspi','PINS_PER_CONNECTOR':19,'TOTAL_CONNECTORS':3,'TAB_NUMS':[1,2,7],'TAB_NAMES':['P1/P5/P6','P2/P5/P6','P7/P5/P6']},
This seems to work correctly. Would still appreciate any additional information or feedback.
Thanks,
Gene
Attachments:
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19196
- Thank you received: 6434
11 Jul 2023 22:20 #275242
by tommylight
Replied by tommylight on topic Trying to add 7C81 to pncconf
"The holy grenade" ???To paraphrase Monty Python "Then, shalt thou count to three 24. No more. No less. Three 24 shalt be the number thou shalt count, and the number of the counting shall be three 24. Four shalt thou not count, nor either count thou two, excepting that thou then proceed to three 24. Five is right out."
Please Log in or Create an account to join the conversation.
- gene_weber
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 6
12 Jul 2023 09:04 #275262
by gene_weber
Replied by gene_weber on topic Trying to add 7C81 to pncconf
Just like a board it had a pin.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- Andy-ABTec
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
15 Dec 2023 17:50 #288242
by Andy-ABTec
Replied by Andy-ABTec on topic Trying to add 7C81 to pncconf
Hi, I'm also currently fighting with pncconf on a rpi4/ 7C81 combo and am getting pretty much nowhere. The 7C81 talks to the pi happily using examples I've found elsewhere in these threads (sudo mesaflash --device 7c81 --addr /dev/spidev0.0 --spi --readhmid and the like). but getting pncconf configured with card details leaves me cold - 15 years as a Linux sys admin and 4 years playing with 3d printers (both marlin/klipper) and I haven't a clue what's next.
Can you please point me in the right direction...
Ta!
Andy B.
Can you please point me in the right direction...
Ta!
Andy B.
Please Log in or Create an account to join the conversation.
15 Dec 2023 18:42 #288255
by PCW
Replied by PCW on topic Trying to add 7C81 to pncconf
You can use pncconf to create a configuration for say a 5i25/G540
and then edit the ini file created to change the card name from 5I25 to 7C81
and finally edit the hal file to change the driver name from hm2_pci to hm2_rpspi
and then edit the ini file created to change the card name from 5I25 to 7C81
and finally edit the hal file to change the driver name from hm2_pci to hm2_rpspi
The following user(s) said Thank You: COFHAL, Andy-ABTec
Please Log in or Create an account to join the conversation.
- Andy-ABTec
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
16 Dec 2023 06:53 #288303
by Andy-ABTec
Replied by Andy-ABTec on topic Trying to add 7C81 to pncconf
Thanks for the quick reply...
Sorry, I'm being really really thick here, I've seen this comment elsewhere in this thread and it didn't make sense to me then either!
The Pncconfig Wizard GUI runs on the Pi quite happily, but I cannot see how to "use pncconf to create a configuration for say a 5i25/G540" - Is there an "Idiots Guide" somewhere?
Again, apologies, and thanks for your patience!
Andy B.
Sorry, I'm being really really thick here, I've seen this comment elsewhere in this thread and it didn't make sense to me then either!
The Pncconfig Wizard GUI runs on the Pi quite happily, but I cannot see how to "use pncconf to create a configuration for say a 5i25/G540" - Is there an "Idiots Guide" somewhere?
Again, apologies, and thanks for your patience!
Andy B.
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.165 seconds