TG9541 / stm8ef-modbus

A lightweight framework for MODBUS RTU nodes in STM8 eForth that can do more than just I/O
https://github.com/TG9541/stm8ef/wiki/Board-C0135
MIT License
32 stars 12 forks source link

Use one buffer for receive and send #34

Closed TG9541 closed 4 years ago

TG9541 commented 4 years ago

The MODBUS protocol is half duplex. This means that there is no need to have a dedicated transmit buffer. The RAM space is better used for one big buffer.

TG9541 commented 4 years ago

This went quite well: the new approach allows up to 16 registers for FC03, FC04 and FC16.

The old approach limited FC03 and FC04 to 5 and FC16 to 13 registers. The new version uses 5 bytes more RAM and "saves" 17 bytes Flash ROM.