Pa,
I had originally thought (mistakenly) you were saying you had ADC circuits which communicated to the mbeds over their (non-magic chip) USB interfaces. Now that I know you are using the mbeds' ADC pins I may be a little more helpful.
The master-slave set-up I am proposing is more of a software technique than a hardware configuration. One mbed is programed to send a signal that means "start now". The other mbed is programed to wait while looking for the signal before running it's ADC sampeling. The mbed that first sends the signal is the 'master', and the mbed that first waits is the 'slave'. After the first signal is sent the roles are usually somewhat reversed, as the master will wait for a (different) signal from the slave to indicate that it has done it's task (or at least begun). Sometimes power-up considerations dictate using reversed signal polarities, or at least some initial delay between configuring the pins and using the handshaking.
The signals could be a 'two wire handshake'. Both the master and slave have one output and one input pin. The output of each is wired to the input of the other. Both outputs are initialized to be low. The master checks (and waits) for the slave signal to be low, then sets it's output pin high as the 'start' signal. The master can then begin it's ADC task. When the slave notices the signal, it sets it's output high (to indicate that it has begun the ADC task). The master responds to the slave's signal by setting it's output low. When the slave finishes it's ADC task it waits for the master's signal to be low, sets it's own signal low, and loops back to wait for the master's next start signal. When the master finishes it's ADC task it set it's own output low, and loops back for another ADC burst.
There are other possible handshaking schemes, such as sending messages back and forth over a (non-magic chip) serial connection, or a 'one-wire' hardware handshake (with open-collector I/O and a wired-or pullup). For minimal delays you can run the hardware handshaking in the 'background' via interrupts and (global) semephores.
If you use the serial port the USB Hub can be eliminated by having the slave's responce signal be a line with it's ADC results. The master can then combine both ADC results into one message for the C# application.
You need to synchronize the mbed's (which usually have slightly different crystal frequencies) and also allow for the USB buffering (with or without the USB hub). The handshaking can be made to add very little delay, just enough to match the faster mbed to the slower. For the serial port scheme you may need to manage extra buffering internal to the mbeds, so that the serial transmissions and ADC tasks overlap (without additional delays). You may need to buffer and overlap with a USB Hub, too.
Fred
Hi All,
I am wondering if there is some possible way to synchronise two mbed boards?. My task is to send data from two working ADC via USB serial port using only one USB connection. I am thinking to connect 2 mbeds to a hub/switch. Does somebody know how this solution will behave? My aim is that data should be sent at the same time...or make some queing