On 8/28/25 3:22 PM, andy pugh wrote:
As far as I can tell, nobody has ever used the onboard serial port
through a HAL component in realtime.
Is there a fundamental reason that this can't be done?

Serial ports are inherently slow, very, very slow. So you need a serial port with enough fifo space not to stall the RT process or you need complex state machine logic to cope with multi-invocation gather scatter logic.

Generally, the data sent on a serial port is a protocol. It needs to be packed/unpacked or otherwise handled. Therefore, no generic module could handle a serial port. You need a protocol handler that is specific for the protocol. Modbus is an example of how complex this can get. Other protocols can even get more challenging, especially when timing is involved. And protocol handlers are usually made using (drum roll...) state machines.


There is a component that directly access the _status_ lines on the
serial port, but that makes no attempt to handle the data lines.

The status lines are, just like the parallel port, simple I/O bits. You can thus use them in a similar fashion. Whether this is a good or bad idea, well, I guess its a YMMV setup ;-) But if you just lack a (non-critical) line or two and don't want to spend another fortune on hardware... it might just be workable enough.

BTW, for some serial chips you need to read the hardware register that has the input/status bits just to reset the serial chip's internal state (like interrupt flag, edge detect, and more). You just throw away the result because the hardware register read action was all that was needed.

--
Greetings Bertho

(disclaimers are disclaimed)



_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to