By "messages" I mean the information passed between LinuxCNC and the microcontroller over the SPI connection. For example LinuxCNC sends (among other things) the desired motor movement and which digital outputs should be on, and the microcontroller sends back the current motor positions and which digital inputs are on, etc. These messages are exchanged at (typically) 1kHz continuously, always with the same message content, about what is happening in the current 1 millisecond time slice.
But the message content could be anything, including settings for the microcontroller. You probably would not want to send settings all the time because it takes up SPI bandwidth, is not really necessary, and some settings might require the microcontroller to be restarted. So I think the settings would need to be saved in some kind of storage onboard the microcontroller. As for how the user can define the settings, the .hal files give us a way to set a large number of arbitrary values that will be accessible to the LinuxCNC component, which can pass them to the microcontroller.
To look at a concrete example. the first thing I would find this useful for is setting the current of the TMC2209 stepper drivers I'm using, which the microcontroller can do via UART. In my .hal file I might have something like:
Code:
setp weeny.config.enabled 1
setp weeny.config.stepper0.current 600 # milliamps
setp weeny.config.stepper1.current 450 # milliamps
The first line would instruct the HAL component to send config messages instead of the normal messages, and the subsequent lines give the values of whatever needs to be set. It would be also possible to switch between config messages and normal messages at run time, although I'm not sure how practical that is. At some point the microcontroller will need to write the settings to storage, which is slow and might cause the SPI connection to drop, but that's not a big problem.
To be fair, I am probably making this sound easy because I'm only looking at one specific microcontroller and I'm basically making my own PCB to run it on so adding extra components like flash storage is no big deal. Whether something like this would be practical to try on the wide range of existing boards that Remora supports is a completely different story. I'm also just outlining an idea I came up with a few hours ago and have never tried, so it could all go badly wrong when I eventually try it out
About the level shifter decision, to be honest I don't know much about these. I forget how I came across the TXB0108 but I just can't get it to work at all, and I've seen a lot of people having problems with it. Somebody suggested 74HCT541 in the comments of my video, so I'm just trying that next. Apparently the 74HCT541 only does translation in one direction which hopefully makes it easier to work with... fingers crossed.