I’m testing an LED Driver for a rear lamp project. The LED is a slave device. The master device is an Aardvark I2C/SPI Host Adapter. I started the tests using the Control Center Serial Software. The slave device responded correctly and the delay between writes and reads was very small, as expected.
After that, I started using the other tests. Initially, the slave device was in timeout and not answering. I fixed that by including the NOT STOP flag. However, the timing between the master device writing to and reading registers was too long – 300-400us. Here are views of the timing per Control Center Serial Software and LabVIEW.
How can I improve the timing performance with LabVIEW?
Response from Technical Support:Thanks for your question! We provide functional examples with our Aardvark LabVIEW drivers. However, the examples we provide only use i2c write and i2c read: two separate functions that affect the timing in your setup. Based on your information, if looks like you need to use register read in a program sequence, which is described below.
As previously stated, our examples use i2c write and i2c read. However, you can create a script that should produce the speed that you need for your setup. Here is an overview of the recommended read-write operation:
Start -> Address (Write) ->Register Offset -> Restart -> Address(Read) -> Read data from slave register -> Stop
How it works:
This sequence combines the write-read together; effectively, this operates as a single register write-read function, which should greatly improve your write-read timing.
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.