0
\$\begingroup\$

I have 2 devices with analog signals. I want to acquire their signal with 2 MCU's (preferably ARM). fully synchronized with the same sampling frequencies, starting and ending simultaneously user controlled (for example by pressing a button). I know that if I could connect them together via wires, I could use oscillator and triggers for this. But is there any way to do this over WiFi? Thanks

\$\endgroup\$
  • \$\begingroup\$ "fully synchronized with the same sampling frequencies, starting and ending simultaneously" - define 'simultaneously'. \$\endgroup\$ – Bruce Abbott Jun 27 at 6:31
0
\$\begingroup\$

Synchronizing end points over a channel like WiFi requires some setup and a reference to a time signal to both devices. One way to envision this is:

  1. Both devices have access to a GPS service to get time information from the GPS network.
  2. Both devices synchronize their local RTCs to the GPS time. The RTC resolution needs to be as good as the maximum latency between ADC triggers in the devices.
  3. The first device sends a test packet to the second device that contains the first device RTC time stamp.
  4. Second device receives this timestamp and comparing it to its local RTC it knows how long the message transmission takes between devices.
  5. Second device acknowledges the test message and sends back the latency time back to first device.
  6. These steps to calibrate may need to be run multiple times to ensure consistent results or re-run periodically do to changing conditions.
  7. First device becomes the master trigger source. It send a trigger message to the second device with the same packet size as the previous test messages. Second device triggers its ADC upon receipt of the message.
  8. First device delays its ADC trigger by the amount of the message latency sent over from the second device during the calibration process.

Note that you will never get triggers at "exactly the same time" using a communications channel for the trigger sync but you can get as close as you can based upon your RTC resolutions and the packet handling variations on each end due to MCU instruction sync and possibly even other interrupt interference on each end.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Not an easy task. You can look for Ethercat master/slave device Ethercat.org. Ethercat uses a distributed clock for synchronising data. Similarly there is a Profinet, also an industrial protocol over ethernet, but it proprietary while the Ethercat is open source.

They are both used in industrial control, where synchronism is important, CNC machines, servo drives,... As far I know, there is no such hardware that supports synchronism through WiFi. Perhaps you could dig into Ethercat and find how these clocks are actually synchronised and implement something for your needs.

Ethercat distributed clocks description

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.