I2C SPI USB CAN eSPI Cable Testing View All Videos Quick Start Guides Software Downloads App Notes White Papers User Manuals Knowledge Base Sales Support About Us
Products Blog Sales Support Contact Search
Can Two Host Adapters Simultaneously Trigger Data Acquisition for Separate I2C Devices?
Rena Ayeras

Triggering an exchange of data with a handshake between separate entities

Illustration by Geralt

Question from the Customer:

I am interested in using the Aardvark I2C/SPI Host Adapter for communicating with I2C devices, specifically ADC. I want to use two Aardvark host adapters to read two of the ADC devices at the same time. My question – is there a way to set up a sync so that the ADC devices acquire data at the same time?

I am using Python scripts. Is there a way I can initiate an I2C acquisition at the same time? I can start two threads in Python for the ADC devices to acquire at the same time, however, with the effects of timing from the Windows operating system, the acquisitions are not simultaneous.

Response from Technical Support:

Thank you for your question! As you observed, due to the commands funneling through the Windows thread and USB scheduling, synchronizing commands to the millisecond is highly unlikely. Our recommendation for syncing data acquisition is sending a trigger to your devices instead of using I2C commands.

Triggering an ADC Device

This recommendation depends on your I2C device being able to receive a trigger. In this case the Aardvark adapter would be in GPIO mode.

Here is a summary of how it works:

  1. Set up the Aardvark I2C/SPI Host Adapters in GPIO mode.
  2. Use the GPIO pin from the Aardvark adapter to generate and deliver a trigger to the device.
  3. After the I2C performs the data acquisition, read the device with the Aardvark adapter over the I2C bus.

Note – the Aardvark adapter can only initiate an API call from your application. There will be some indeterminate timing.

Triggering with I2C

If using a GPIO pin is not compatible with the device, the available MOSI/MISO pins can be used as GPIO pins for triggering the I2C device with the Aardvark Software API. This API supports all GPIOs - I2C+SPI, I2C+GPIO, SPI+GPIO - which can be configured with the aa_configure() function. Other functional scripts are provided with the API. For more details, please refer to  the API Documentation and the information that is provided with the API scripts, which can be downloaded for free

To quickly check your software design, you can use the Control Center Serial Software to verify the concept before implementing API.

We hope this answers your questions. Additional resources that you may find helpful include the following:

If you want more information, feel free to contact us with your questions, or request a demo that applies to your application.