Constantin
Well-known member
Silly question of the evening (Merry Christmas!)
Let's say, you have a gaggle of RS485 clients on a half-duplex bus that is administered by one master unit (Teensy). The clients perform DAQ services that are cataloged on a second-by-second basis. Ideally, all measurements are concurrent, i.e. every second-long measurement cycle starts within 10ms or so. I have been thinking about the best way to synchronize the various MCUs attached to the bus and wonder if the following high-level approach makes sense:
1) Put a good clock signal on the master unit (i.e. SIT1552, for example)
2) The master notes how many us have elapsed since the last time that second() changed on the master. Store this offset.
3) Address all clients on the RS485 bus in a broadcast fashion and transfer the offset.
4) The clients use offset info to synchronize their measurement cycles to those of the master.
5) Every x hrs, re-synchronize the clocks.
This could be a good use for ElapsedMillis? I.e. base the timing of measurements using ElapsedMillis and then fix any offsets using the master unit.
Let's say, you have a gaggle of RS485 clients on a half-duplex bus that is administered by one master unit (Teensy). The clients perform DAQ services that are cataloged on a second-by-second basis. Ideally, all measurements are concurrent, i.e. every second-long measurement cycle starts within 10ms or so. I have been thinking about the best way to synchronize the various MCUs attached to the bus and wonder if the following high-level approach makes sense:
1) Put a good clock signal on the master unit (i.e. SIT1552, for example)
2) The master notes how many us have elapsed since the last time that second() changed on the master. Store this offset.
3) Address all clients on the RS485 bus in a broadcast fashion and transfer the offset.
4) The clients use offset info to synchronize their measurement cycles to those of the master.
5) Every x hrs, re-synchronize the clocks.
This could be a good use for ElapsedMillis? I.e. base the timing of measurements using ElapsedMillis and then fix any offsets using the master unit.
Last edited: