Skip to content
← All projects
Embedded2026

MODBUS Communication Module for Industrial Equipment

Industrial measurement equipment manufacturer

A MODBUS RTU communication module that lets STM32-based equipment exchange data with a flow meter over RS-485. We delivered the Slave first, then built the Master under a follow-up contract.

Deliverables
Firmware moduleUnit testsTechnical documentation
Tech
C11STM32FreeRTOSRS-485Unity

Problem

The equipment needed MODBUS communication. It needed both a Slave that provides equipment values to the host system and a Master that reads values directly from a connected ultrasonic flow meter.

Constraints

  • It had to run on FreeRTOS within a 512-byte stack for the communication task.
  • Frame boundaries at 9,600 bps had to be detected precisely using interrupts only, without DMA.
  • We needed a way to verify protocol behavior before connecting to real equipment.

Solution

  1. 1

    The protocol logic was separated into pure C with no hardware or RTOS dependencies, tested on a PC first, then loaded onto the equipment.

  2. 2

    The receive interrupt collects bytes, and a frame is finalized when the line goes idle, which keeps frame boundaries correct.

  3. 3

    The Master includes timeouts and retries, periodic polling, and marks a device offline after repeated failures.

  4. 4

    Testing with the real flow meter revealed a register addressing rule that differed from the documentation examples, and it was corrected.