Category: Driver Boards
There's been a couple of things I was thinking about for a while and the more I dig in the more I wonder about why they haven't become a thing with LinuxCNC. When I have other uses for something I tend to think "will this work with LinuxCNC too?" I suppose everyone gets used to doing things a certain way and only pick up new things if they are the hot new thing (like EtherCAT). There are probably a couple of interfaces that are "just there" that should technically be fully realtime capable. I think alot of it also stems from the fact that when people were using parallel ports on desktop motherboards, Mesa popped up with PCI and Ethernet cards and that's just the way it went. Nowadays I like to use mini-PCs like Odroid H3/H4, I still use some H2's as well. These have UART and I2C ports right on the "GPIO" header, interestingly the GPIO header doesn't actually have GPIO. I use these because they're cheap, small and have 2 ethernet ports. I would still use a Mesa Ethernet card for most bigger things but I run into alot of cases where they don't have anything convenient to use in the place I want to use it. The reason (besides being readily available) that I would think about UART and I2C is that they are simple and easier to deal with for something custom.
Unless I'm missing something, both UART and I2C should be fully realtime capable. Niether is the fastest interface out there but I don't think they really have to be. The appeal for I2C is there are already a bunch of kernel drivers for specific ICs, IO expanders like MCP23017. Currently these are only used in userspace components etc., but if the interrupt output is used I think it can meet RT expectations, especially if you can run the bus at 1Mhz+. I've gotten these IO expanders to work with the kernel driver on the H-series as I needed something to register as a gpiochip for use with other kernel drivers. The LinuxCNC RT bits just don't exist yet. The thing about it is there are clockgens, ADCs, etc, that all have kernel drivers. There obviously needs to be a hal compenent for this stuff, I'm going to play with it soon but what it seems to me is that if the HAL environment existed, you could literally breadboard a controller based on just I2C chips that have suitable kernel drivers. There's a limit of chips that can be strung in there before transaction queues start to build up but besides that, I think this could be a thing. SPI could be used in much the same vein as many I2C chips have SPI variants and generally have an associated kernel driver.
UART/Serial is also probably realtime capable as a host interface (NOT USB serial). Again Ethernet is better but AFAIK I think Intel UARTs can be run at over 3 Mbaud, that's pretty quick but I'll have to test that as I've never actually seen or heard of it being done. I wouldn't expect this to be super popular since again there are better ways to do this but the main reason I'd want to use UART is for a control panel host. Right now I'm using Arduino Connector to a custom board running a Teensy 4.1. It works, it's fine but Arduino Connector is userspace/Python. Typical use is with the USB serial port, should be usable with a UART instead but probably not gaining anything being userspace. I'd like to replace Arduino Connector with a realtime UART setup to the Teensy board. At this point I'll probably just switch to an ESP32 S3 for other reasons but I don't want to deal with anything like Ethernet. This is something else that needs HAL implimentation but I will start with some simple tests just to see what I can do with it.
I'm curious if I'm missing anything from a bus/hardware perspective. I'm not concerned with why these aren't already popular choices, I think I've already mentioned that. More concerned with what I might be missing as far as implimenting them goes. I can't find a great reason why either of these wouldn't be perfectly fine to use as RT interfaces, albeit with some limitations.