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.
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:
Note – the Aardvark adapter can only initiate an API call from your application. There will be some indeterminate timing.
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.