views:

74

answers:

2

I have a WinCE master board wich is connected by serial ports to several remote slave boards. These slaves boards measures potentials. The communication protocol between master ans slaves is based upon MODBUS.

The master request a measure to one different slave every 300ms. The slave targetted is changed for each request.

My problem is that I have to timestamp the received measures. So, how can I synchronize all slave boards to have an identical time reference for all ? The synchronisation have to pass through the serial commuinication which is not real time determined !

A: 

A lot depends on the rest of your hardware, really. Ideally you have a clock signal going from the master to each board which keeps all of the local clocks on the same time reference. As an initial synchronization mechanism, you can send down a MODBUS register write to preload a future time and then use one of the other serial port lines (DTR, CTS, etc.) as a trigger to load that time into the clock on the slave board.

Chris Ryding
A: 

Thank's for your help.

But, unfortunaly, we can't use a hardware clock signal: Our devices are connected to each other with standard entreprise connectors and cables, wich have only 4 wires: RxD, TxD, Vcc & Gnd.

So, I'm looking for a 'sofware only solution'.

I think it must exists, as my own PC has a web synchronisation for time and date ! (although i want a synchronization accuracy of the milli-second...)

Any idea ?

Loic Berthollet