- Hardware & Machines
- Computers and Hardware
- LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
- meister
- Offline
- Platinum Member
-
Less
More
- Posts: 804
- Thank you received: 501
11 Aug 2026 09:48 #348643
by meister
Replied by meister on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
new driver plugin: TMC5160 via SPI:
www.youtube.com/shorts/DlIHY1Iy-ZQ
I don’t really like AI, but I do give it a go every now and then.
But this time I have to admit that gpt-5.6-sol-xhigh
did a pretty good job of it; it understood how a Rio plugin is structured and also generated the Verilog code quite neatly.
So this is the first plugin I’ve created with the help of AI.
I’d had the drivers for a while, but I was always too lazy
The tricky bit here was realising that, although the drivers use SPI (for configuration), they can’t be controlled via SPI.
To do that, you have to re-solder a tiny resistor on the back – not much fun.
So if you’re going to do this, get a board with the right jumpers for SD mode and SPI mode.
www.youtube.com/shorts/DlIHY1Iy-ZQ
I don’t really like AI, but I do give it a go every now and then.
But this time I have to admit that gpt-5.6-sol-xhigh
did a pretty good job of it; it understood how a Rio plugin is structured and also generated the Verilog code quite neatly.
So this is the first plugin I’ve created with the help of AI.
I’d had the drivers for a while, but I was always too lazy
The tricky bit here was realising that, although the drivers use SPI (for configuration), they can’t be controlled via SPI.
To do that, you have to re-solder a tiny resistor on the back – not much fun.
So if you’re going to do this, get a board with the right jumpers for SD mode and SPI mode.
The following user(s) said Thank You: viewsat, jpn9900
Please Log in or Create an account to join the conversation.
- meister
- Offline
- Platinum Member
-
Less
More
- Posts: 804
- Thank you received: 501
12 Aug 2026 14:10 #348666
by meister
Replied by meister on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
@viewsat
Wow, OK, I can picture it – that’s intense
Even at low speed – wtf
Wow, OK, I can picture it – that’s intense
Even at low speed – wtf
Please Log in or Create an account to join the conversation.
- meister
- Offline
- Platinum Member
-
Less
More
- Posts: 804
- Thank you received: 501
12 Aug 2026 14:38 #348667
by meister
Replied by meister on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
Sometimes it can be an advantage to be a bit lazy 
Otherwise, I wouldn’t have been able to reproduce it.
At first, I had the driver connected directly to the TangNano9k (3.3V),
then I had a quick Google to see if anyone else was having problems with the DM542. Yes, they were, because of the 3.3V. Now I’ve connected it to the Tangoboard with 5V signals and everything’s working perfectly, with the default settings
www.youtube.com/shorts/3IeqAu58WdI
Otherwise, I wouldn’t have been able to reproduce it.
At first, I had the driver connected directly to the TangNano9k (3.3V),
then I had a quick Google to see if anyone else was having problems with the DM542. Yes, they were, because of the 3.3V. Now I’ve connected it to the Tangoboard with 5V signals and everything’s working perfectly, with the default settings
www.youtube.com/shorts/3IeqAu58WdI
Please Log in or Create an account to join the conversation.
- viewsat
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 9
12 Aug 2026 23:30 #348673
by viewsat
Replied by viewsat on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
Attachments:
Please Log in or Create an account to join the conversation.
- viewsat
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 9
13 Aug 2026 00:21 - 13 Aug 2026 02:19 #348679
by viewsat
Replied by viewsat on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
Attachments:
Last edit: 13 Aug 2026 02:19 by viewsat.
Please Log in or Create an account to join the conversation.
- viewsat
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 9
13 Aug 2026 00:27 #348680
by viewsat
Replied by viewsat on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
Attachments:
Please Log in or Create an account to join the conversation.
- viewsat
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 9
13 Aug 2026 01:02 - 13 Aug 2026 03:13 #348681
by viewsat
Replied by viewsat on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
If I replace the DIR PC817 optocoupler with a high-speed 6N137, it can correctly return to the zero position.
However, using grbl and mesa 7i92 does not require modifying the DIR pc817.
I may need to use a logic analyzer to observe the timing diagrams of the Tang Nano 9k output pulses and DIR
I'm from Taipei, Taiwan, and my English isn't very good.
However, using grbl and mesa 7i92 does not require modifying the DIR pc817.
I may need to use a logic analyzer to observe the timing diagrams of the Tang Nano 9k output pulses and DIR
I'm from Taipei, Taiwan, and my English isn't very good.
Attachments:
Last edit: 13 Aug 2026 03:13 by viewsat.
Please Log in or Create an account to join the conversation.
- tuxcnc
- Offline
- Elite Member
-
Less
More
- Posts: 230
- Thank you received: 42
13 Aug 2026 03:32 #348683
by tuxcnc
By modifying the driver, you risk damaging it and reducing its reliability.
Although the PC817 has a very low bandwidth, the correct solution is to increase the dirhold.
Replied by tuxcnc on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
This is wrong way.If I replace the DIR PC817 optocoupler with a high-speed 6N137, it can correctly return to the zero position.
By modifying the driver, you risk damaging it and reducing its reliability.
Although the PC817 has a very low bandwidth, the correct solution is to increase the dirhold.
Please Log in or Create an account to join the conversation.
- meister
- Offline
- Platinum Member
-
Less
More
- Posts: 804
- Thank you received: 501
13 Aug 2026 04:29 #348685
by meister
Replied by meister on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
All my positive terminals are connected to the purple cable via a thin wire.
Dirhold isn’t the problem; it really is the voltage that’s coming through – there was a clear difference between 3.3V and 5V.
My connections are like in your image, but with EN connected.
You could use a multimeter to check what voltage is coming through your DIR pin.
Dirhold isn’t the problem; it really is the voltage that’s coming through – there was a clear difference between 3.3V and 5V.
My connections are like in your image, but with EN connected.
You could use a multimeter to check what voltage is coming through your DIR pin.
Please Log in or Create an account to join the conversation.
- viewsat
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 9
13 Aug 2026 06:23 - 19 Aug 2026 07:45 #348686
by viewsat
Replied by viewsat on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
DIR/PULSE issue resolved, thank you!! (2026-08-19)
Hi tuxcnc
I tried increasing the dirhold (PULSE=10, DIR=25) but it still didn't return to the origin correctly. When using a stepper motor, I pay attention to the Sequence Chart of Control Signals. If I use a Leadshine DM542 uses HCPL-063L/15MB high-speed optocouplers for both the DIR and Pulse inputs, so there are no problems using it.
Because increasing the dirHOLD time should have solved the problem, but it didn't. If Riocore hadn't fixed the DIR issue with the cheap DM542 driver mentioned earlier, I could only replace the pc817 with a 6N137. However, I still really hope that Meister will pay attention to this problem.
Hi tuxcnc
I tried increasing the dirhold (PULSE=10, DIR=25) but it still didn't return to the origin correctly. When using a stepper motor, I pay attention to the Sequence Chart of Control Signals. If I use a Leadshine DM542 uses HCPL-063L/15MB high-speed optocouplers for both the DIR and Pulse inputs, so there are no problems using it.
Because increasing the dirHOLD time should have solved the problem, but it didn't. If Riocore hadn't fixed the DIR issue with the cheap DM542 driver mentioned earlier, I could only replace the pc817 with a 6N137. However, I still really hope that Meister will pay attention to this problem.
Attachments:
Last edit: 19 Aug 2026 07:45 by viewsat.
Please Log in or Create an account to join the conversation.
- Hardware & Machines
- Computers and Hardware
- LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)
Time to create page: 1.471 seconds