A.J.710
- 56
- 1
- TL;DR Summary
- Have a sensor/controller board pushing large amounts of information to a communication board and need a more professional way to synchronize them.
This started out as a simple controller only but kept advancing without ability to change the existing architecture and now it's getting too messy. I'm seeking recommendations on architecture or C libraries or anything to help clean this up because a major change is needed and I'd like to seize the opportunity to revamp the architecture.
Without giving too much info on use case etc.:
Board 1 is an MCU with an array of sensors including analog, i2C, and UART that controls multiple PWM and GPIO output channels. Timing is critical and control loops are tight. This board is self-sustainable but can be synced with Board 2 over UART.
Board 2 is a communication board. It syncs with Board 1 over UART and functions as a user interface over an ethernet connection. In order for information to be available to a user instantly, this board has a cache that is basically a copy of all of the parameters coming from Board 1. Synchronization is handled in the background sometimes the info can lag slightly behind.
The main issue here is the syncing of data between these two boards. This was never intended to get so advanced but after various additions, we are approaching levels of now hundreds of parameters needing to be synced between these two boards and of course the desire to be instantly available and updated. The protocol for information transfer was developed by me from scratch but it is getting unsustainable at this rate of expansion. Basically a packet structure of several bytes including metric category, sensor or controller type, sensor or controller number, data, and a parity/check to verify receipt.
Board 2 is always running an open UART read loop so any updates Board 1 sensors have are pushed immediately and stored in Board 2 cache.
Board 1 similarly is always listening so Board 2 can send updates induced by the user ethernet interface. It's programmed to receive, update internally, and then respond with that same parameter's data to Board 2 so that the cache is updated to reflect the newest update or old data if for some reason it can't be changed or is locked out or something.
Since everything is basically running in loops, this is getting too much to handle. Especially during board initialization where Board 2 polls Board 1 for every single parameter to fill up its cache. This is a sequence of like 1,000+ UART transfers every time it turns on and this takes forever. Also with so many parameters, updates are starting to get missed because they can't get processed in time due to the such critical timing of Board 1's functionality. This is where the opportunity to revamp is because I have to double the capacity of board 1 and in the meantime can update the MCUs and firmware on both boards to accommodate. I don't have much experience with advanced communication architectures and stuff so that's where I am looking for recommendations. Any help would be greatly appreciated.
Without giving too much info on use case etc.:
Board 1 is an MCU with an array of sensors including analog, i2C, and UART that controls multiple PWM and GPIO output channels. Timing is critical and control loops are tight. This board is self-sustainable but can be synced with Board 2 over UART.
Board 2 is a communication board. It syncs with Board 1 over UART and functions as a user interface over an ethernet connection. In order for information to be available to a user instantly, this board has a cache that is basically a copy of all of the parameters coming from Board 1. Synchronization is handled in the background sometimes the info can lag slightly behind.
The main issue here is the syncing of data between these two boards. This was never intended to get so advanced but after various additions, we are approaching levels of now hundreds of parameters needing to be synced between these two boards and of course the desire to be instantly available and updated. The protocol for information transfer was developed by me from scratch but it is getting unsustainable at this rate of expansion. Basically a packet structure of several bytes including metric category, sensor or controller type, sensor or controller number, data, and a parity/check to verify receipt.
Board 2 is always running an open UART read loop so any updates Board 1 sensors have are pushed immediately and stored in Board 2 cache.
Board 1 similarly is always listening so Board 2 can send updates induced by the user ethernet interface. It's programmed to receive, update internally, and then respond with that same parameter's data to Board 2 so that the cache is updated to reflect the newest update or old data if for some reason it can't be changed or is locked out or something.
Since everything is basically running in loops, this is getting too much to handle. Especially during board initialization where Board 2 polls Board 1 for every single parameter to fill up its cache. This is a sequence of like 1,000+ UART transfers every time it turns on and this takes forever. Also with so many parameters, updates are starting to get missed because they can't get processed in time due to the such critical timing of Board 1's functionality. This is where the opportunity to revamp is because I have to double the capacity of board 1 and in the meantime can update the MCUs and firmware on both boards to accommodate. I don't have much experience with advanced communication architectures and stuff so that's where I am looking for recommendations. Any help would be greatly appreciated.