How to design new driver for my own board

More
22 Jun 2025 21:58 #330732 by vitali
Hi.
I am new in Linuxcnc. I am going to design my own board use FPGA. I do not know how to make driver. I have experience in c c++. May be somebody knows how to do it, or where i can take any sample driver or any information.

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

More
22 Jun 2025 23:19 #330737 by meister
Replied by meister on topic How to design new driver for my own board
Comp-Style:
github.com/jzolee/HAL2UDP/blob/2.0/LinuxCNC%20driver/udp.comp

pure C/C++
github.com/scottalford75/Remora-NVEM/blo...emora-nv/remora-nv.c

what FPGA you want to use ? Verilog, VHDL, nmigem ,... ?
Open Source or closed ?

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

More
23 Jun 2025 03:25 #330746 by unknown
Replied by unknown on topic How to design new driver for my own board
Basically you can make an FPGA design that uses a Spartan 6 and use the mesa hostmot2 firmware. No need to develop fpga code or write a new driver.

Here's an example
github.com/ozzyrob/Linuxcnc-FPGA

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

More
23 Jun 2025 12:06 #330754 by vitali
Replied by vitali on topic How to design new driver for my own board
Thank you for the help. I am going to use EP4CE10E22, Verilog, and it will be open source project.
Board parameters:
Dimensions 67x76x20 mm
Weight 60g
Supply voltage 12-24V
Power 0.5 W
Opt. isolated inputs 24
Outputs: digital 16 (0.5A max)
analog 2 (0-10V)
JTAG, USB
The following user(s) said Thank You: meister

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

More
23 Jun 2025 12:36 #330755 by vitali
Replied by vitali on topic How to design new driver for my own board
Sorry
Power 5 W
Attachments:
The following user(s) said Thank You: meister, unknown

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

More
23 Jun 2025 12:50 #330756 by meister
Replied by meister on topic How to design new driver for my own board
sweet :)

and for the host interface USB?
this will not really work :(
LinuxCNC is a little bit different to other controller like GRBL,
you need a realtime loop between board and host and this will only work with Ethernet/Ethercat/SPI(raspberry) or LPT., not with USB or UART.

If you need almost ready to use Gateware/Drivers for your board, you can look at:

github.com/multigcs/riocore/
(github.com/multigcs/riocore/blob/dev/doc/BOARDS.md)

this is a gateware generator and all the FPGA stuff is written in verilog,
but it use W5500 UDP interface or SPI.
There is also an UART/USB plugin, but only for testing, not for realtime use.

you can take a look on my youtube channel, there are many videos with different FPGA's running RIO:
www.youtube.com/@unixconf/

but i can understand if you prefer to write your own software, it's also fun :)

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

More
23 Jun 2025 22:56 #330781 by unknown
Replied by unknown on topic How to design new driver for my own board
The major difference re GRBL & Linuxcnc is that Linuxcnc (what runs on the PC) is interprets the gcode and works out the timing & responds to realtime events.

With GRBL the PC sends gcode to the GRBL controller and that interprets the gcode.

There is no option (and so far it does that like it will ever be an option) to send gcode to an external controller.

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

More
24 Jun 2025 18:24 #330812 by vitali
Replied by vitali on topic How to design new driver for my own board
I am going to install Linuxcnc on Orange Pi PC Plus. OPC send to FPGA controller
Speed and Axis coordinate in steps. FPGA controller has buffer for all parameters. According my calculations USB speed is enough to work in real time.

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

More
24 Jun 2025 23:34 #330831 by unknown
Replied by unknown on topic How to design new driver for my own board
It's not speed that is the issue, it's regularity. Once you introduce a buffer you lose the ability for realtime response.
There's a reason that no USB development has been done for Linuxcnc.
Search the forum for questions related to USB and you'll get the same response over and over.
Mesa has one or two boards that have USB interfaces but none are used for Linuxcnc.

As previously stated, Ethernet, SPI or EPP are the way to go. USB maybe ok for control panels for non realtime input, but disconnection can be an issue.

I really suggest you look into it more, especially the difference between speed and regularity. You may also want to look to see if USB has any realtime drivers.

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

More
25 Jun 2025 02:20 #330842 by DMNZ
if you plan to use Orange PI why not just dedicate few pins and use SPI. RIO already has the driver and i believe works on other spartan 6 boards like a charm. you can use usb for firmware updates and non real time data (like pendant for example). usb has great speed but absolutely no guarantee time wise especially if your board will identify itself as vendor specific class. you can try to play with usb audio devices class, which seem to have better latency but you may still be disappointed after all that hard work you plan to do.
The following user(s) said Thank You: unknown

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

Moderators: PCWjmelson
Time to create page: 0.095 seconds
Powered by Kunena Forum