Keeping data on multiple STM32s in Sync
Hello,
I need guidance on how to best implement a packet protocol to keep the data on multiple STM32F373 in sync with each other. If possible, I would like to reach a 'refresh rate' of 30ms. Packet payloads for data refreshed could be up to 50 bytes.
I currently have 1 'master' uC, and it connects to about 20 slave 'module' devices over SPI as master-slave. The master also connects to up to 12 'control panel' devices over a second SPI. The modules gather and output data while the control panels allow the user to read and change values on the modules.
I would like to refresh the control panels and modules as fast as possible. ( 30ms would be ideal )
The issue seems to be that polling 10 or more devices at 115200baud will result in jitter even with packets as small as a few bytes. Having each module send ALL data on each poll cycle seems inefficient when the data has not changed, but at the same time including all the data makes the timing deterministic which is a benefit.
I am considering using an event based protocol instead, where slave modules and control panels only send data when the data has changed, however I think if all data has changed the jitter may appear, but less frequently and more difficult to detect/troubleshoot.
I'm thinking of having control panels simply broadcast a packet to the slave instead of waiting for a response. ( that would remove the timeout retry part of my protocol potentially causing other issues )
I'm also looking at setting up a multi-master SPI but I don't think that will help with jitter.
I have always been curious about how others have addressed this.
Thank you,
