LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

More
2 years 1 week ago - 2 years 1 week ago #312939 by gitano
...just discovered this a few days ago and i am really impressed! Really nice work, also with the configuration wizard in the docker container! 

Just stepped inside the LinuxCNC world with a rudimentary BOB setup, so maybe a bit early... but i am really considering having a look at this :)

Cheers!
-lgitano
Last edit: 2 years 1 week ago by gitano.

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

More
2 years 1 week ago - 2 years 1 week ago #312969 by digiex_chris
Last edit: 2 years 1 week ago by digiex_chris.

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

More
2 years 1 week ago - 2 years 1 week ago #312976 by digiex_chris
 did a little small rework of the IceShield to make it so that JLCPCB can assemble the SMD parts for us, just got them in my hands. I just soldered the through hole components myself, it's pretty easy. I rearranged the connectors so that the routing to the FPGA is a little simpler, because everything has to be on one side of the board if we want the low cost assembly ($7 USD to assemble 5 boards!!! not including components). I used 4 layers for RFI reasons and making it easier to route to power and ground planes with single sided SMD assembly, and the cost to produce the board only increases by $1.50 USD to go to 4 layers.

They arrived yesterday, I plugged it in and was able to flash it using the riocore tooling, but linuxcnc throws bad data warnings with lots of zeros (I assume that's a log of the request data). I have to confirm my CE0 pin is hooked up correctly, that JLCPCB didn't flip the 2v5v dropping diode, and go take a look with a logic analyzer, but I'm wondering if there's some tooling somewhere to interact with the IceShield in a simpler way, perhaps command line? So I can test it without having to run linuxcnc.

The firmware seems to run, because it lights the one LED after it's flashed and rebooted. I have a feeling I have permission issues with the GPIO pins used by the chip select pins, I had to run as root to flash it but linuxcnc isn't happy running as root, something to do with rtapi_app running without a backup uid.  /dev/spidev* are the correct permissions in the spi and gpio group, my user is in that group, but running the flash script as my user fails for permission problems with gpio. That's just linux problems, those I can deal with, just ran out of time. @meister are you running your iceshield on the official linuxcnc pi image? Do you still use it over spi or have you converted yours to an ethernet spi bridge?

[img
Last edit: 2 years 1 week ago by digiex_chris.
The following user(s) said Thank You: kostas, meister

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

More
2 years 1 week ago #312978 by digiex_chris
total cost for 2 assembled boards and 3 spare unpopulated pcbs shipped to Canada was $96CAD, so just under $50/board. Not bad! That goes down with a larger order of course, the assembly fee doesn't really go up much to populate all 5 boards, it's just I didnt want to pay the parts costs if I'd made a mistake and it doesn't work.

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

More
2 years 1 week ago #312981 by meister
Hi,
very cool !!!!

for my board without oscillator, i need to run:
```
gpio mode 7 clock
gpio clock 7 5000000
```
to provide a clock signal for the FPGA


for flashing i use this script:
```
riocore/configs/IceShield/spiflash.sh
```
all as root.

LinuxCNC runs as user,
i think i use the normal LinuxCNC RPI image (bookworm)

if you use the default config with:
```
{
"type": "blink",
"pins": {
"led": {
"pin": "LED:G"
}
},
"frequency": 1.0
},
```
on of the LED's have to blink with 1Hz after flashing

to test the connection, you can also use the rio-test tool:
```
bin/rio-test riocore/configs/IceShield/config.json
```
The following user(s) said Thank You: digiex_chris

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

More
2 years 1 week ago #313024 by digiex_chris

Hi,
very cool !!!!

for my board without oscillator, i need to run:
```
gpio mode 7 clock
gpio clock 7 5000000
```
to provide a clock signal for the FPGA


for flashing i use this script:
```
riocore/configs/IceShield/spiflash.sh
```
all as root.

LinuxCNC runs as user,
i think i use the normal LinuxCNC RPI image (bookworm)

if you use the default config with:
```
{
"type": "blink",
"pins": {
"led": {
"pin": "LED:G"
}
},
"frequency": 1.0
},
```
on of the LED's have to blink with 1Hz after flashing

to test the connection, you can also use the rio-test tool:
```
bin/rio-test riocore/configs/IceShield/config.json
```
 
It works! Thank you, the GPCKL0 gpio config was just what I needed. Linuxcnc talks to it just fine now. Also, it seems I forgot to route pin 7 to 35 on the FPGA :D

I'll adjust the board to route that line, dump a production outputs file and instructions for people to order it, and push it up to github along with the config once I confirm the motors and switches do what I need them to do for a standard 3 axis mill setup.
[img

 
The following user(s) said Thank You: meister

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

Time to create page: 2.083 seconds
Powered by Kunena Forum