I am using the Aardvark I2C/SPI Host Adapter with an I2C device. I need to read and write to specific registers, such as:
How can I best approach this task?
Response from Technical Support:Thanks for your question! For writing and reading to a register, we recommend using our free application, Control Center Serial Software, in batch mode.
When using the GUI dialog, the register read operation in the Control Center Serial Software is streamlined. The I2C write and I2C read transactions are combined, which makes this operation easier for the user. However, that method does not supporting writing to and then reading from different registers. In batch mode, you can easily write more detailed scripts, such as writing to one register address and reading from another register address.
For example, to read 4 bytes from register address 0x11 on I2C slave 0x55, you can do the following.
f<i2c_read addr=" count="4"/>
Shown below is an example of a full I2C transaction that is sent on the I2C bus for master register write/read.
Master Register Write:
The Control Center Serial Software will display the transaction log. To understand the transaction log, we recommend referring to the I2C specification of your target device and compare that information with the sequence shown in the transaction log.
For an example of implementing writing to an I2C device and then reading from a specific register, please refer to the article Which Software Tool Should I Use with the Aardvark I2C/SPI Host Adapter to Read the Status Register Information?
You can also watch an example of using the Control Center Serial Software in batch mode. This video includes writing and implementing an XML script, and watching the transaction log.
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.