Doing more with STM8 eForth MODBUS - a Video and Client Experiments

A project log for MODBUS Things with STM8 eForth

Projects (and mishaps) for talking MODBUS to STM8 eForth

ThomasThomas 07/04/2022 at 04:540 Comments

Unlike many other sources of Chinese modules with STM8 chips the good old C0135 MODBUS-RTU 4-Relay Boards with STM8S103F3P6 chips are still available for a fair price - and with the right software they're still a great stock component for small automation tasks.

I had been invited to talk about how to interactively develop MODBUS Server an applications with STM8 eForth. In MODBUS lingo a "server" is a node that listens to a MODBUS Client. 

Even if the server does its own thing (e.g., not just issue NEC-IR codes like in the demo above but also, say, react on ambient light or local user input devices), there is still a thing missing: actively send data to anther node. We can call that a MODBUS client - but why not to call it a peer?

It's true, the MODBUS-RTU protocol was never designed for multi-master operation but that doesn't mean that with a tiny bit of protocol and timing on top it can't be used to freely share bits of data between nodes.

First experiments are very promising (requesting and receiving data works). While experimenting with the MODBUS client code I found and fixed a bug that made the node release the bus too early in the first transmission after reset.

In order to enable implementations of FC23 ("Read/Write Multiple Registers") the FC->XT table encoding was improved.