We are using the Aardvark I2C/SPI Host Adapter and Control Center Serial Software to interact with an I2C slave device. Our challenge is the bitrate of the target device is 500 Hz, which is below the bitrate range that the Aardvark adapter supports: 1000 Hz. The details of our setup:
When the I2C transaction between FPGA and the slow I2C completes, we release the SCL of the Aardvark adapter and put ACK on the dongle SDA line. This is where we have a problem. We expect the Aardvark adapter to toggle the SCL and read the ACK bit. But instead, the SCL remains high – it is as though the bus is locked.
Is there a way to successfully operate at a slower speed?
Response from Technical Support:Thank you for your question! In I2C mode, the Aardvark I2C/SPI Host Adapter operates from 1 kHz to 800 kHz. In your case, the period that SCL is held low can be extended, which effectively slows down the bitrate. This method is available with our Aardvark Software API, which is described below. As bus locks can occur for various reasons, we also include troubleshooting tips.
The SCL line can be held low for an extended period by using the API command aa_i2c_bus_timeout. The maximum time for bus timeout is 450ms, which should work for the 500 Hz bitrate. Here is a summary of how that command works:
For more information, please refer to API Documentation section the Aardvark I2C/SPI Host Adapter User Manual
Here is additional information about what causes bus lock and troubleshooting tips.
When a bus lock occurs, it may be caused by the interactions from the Aardvark adapter or from the target adapter.
Here is an easy way to diagnose this lock condition:
This method clarifies if the Aardvark adapter or the target device is locking the bus.
Note - when bus lock occurs, the only way to unlock the bus is to disconnect and power cycle the Aardvark adapter. To prevent timeout from locking the bus, the API command aa_i2c_bus_timeout can be used to extend the timeout to 450ms, or if needed, reduce it to 10ms.We hope this answers your question. 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.