Watch the full implementation on our YouTube channel and see it in action:
🔗 Watch Now
- AGENDA
- OVERVIEW
- MAX484 TTL TO RS485 CONVERTER
- CONNECTION DETAILS
- HIGH-LEVEL IMPLEMENTATION
- MODBUS MASTER FIRMWARE
- MODBUS SLAVE FIRMWARE
- TIMMING & EVENT ANALYSIS
- PROJECT MASTER-SLAVE
- SUMMARY
- LIVE DEMO
- THANK YOU
- Overview
- 1-Master, Multi-Slave
- Modbus Master Firmware
- Modbus Slave Firmware
- Events and polling rate timing rate
- Live Demo: Implement Modbus RTU Master Slave on STM32 MCU
- Summary
- Ask Questions?
- Allows single controller to manage multiple devices efficiently
- Provides Interoperability between multiple Modbus RTU’s
- Ease of integration due to widely adopted by many manufacturer
- Efficient & Reliable communication: deterministic response, error checking
- Suitable for Industry environment: with RS485 physical layer communication up to several hundreds of meter with better noise immunity
- Scalability for Multi-device communication:
- Device addressing
- Polling mechanism
- Input Voltage: 5V DC
- Output Voltage: RS485 differential signal
- Communication: Half-duplex RS485
- Distance: Up to several hundred meters
- MODBUS MASTER
- MODBUS SLAVE
Examples of system architecture:
- STM32 + RTC + MAX485 + I2C OLED + Switch
- Master and multiple slaves (ID 0x01, 0x02)
- Switch status polling:
- Slave-1: 200 ms
- Slave-2: 600 ms
- Data displayed on OLED
- Timestamp synchronization
- Read RTC time from serial on time update command
- Broadcast RTC time on Modbus switch pressed
- Poll Switch status every 200ms from Slave-1
- Poll Switch status every 600ms from Slave-2
- Display time on OLED
- Display Slave-1 event time stamp
- Display Slave-2 event time stamp
- 8 Modbus register to receive the time from the master
- 1 discrete input for switch status
- Whenever Switch pressed, capture the status in discrete input
- Display time on OLED
- Display last poll received time stamp
- Switch event time stamp
- Switch pressed (Slave1)
- Switch pressed (Slave2)
- Event updated to master from Slave1
- Event updated to master from Slave2
Visual data shows event update intervals (in milliseconds):
200 → 2400 → 2200 → ...
- Low cost, better noise immunity
- Scalable: connect up to 32 Slave devices
- Best suited for monitoring devices in industrial automation
- Avoid using for real-time controlling
- Continuous polling by master poses risk of timing mismatch
Watch the full implementation of Modbus RTU Master-Slave Firmware on STM32 MCU:
🔗 Watch on YouTube
Thanks for being a DevHead!
Join our community: https://discord.gg/DevHeads
Devheads.io – A place for every dev