I am learning to use the Aardvark I2C/SPI Host Adapter with the Aardvark Software API aai2c_file example. One of the arguments this method requires is the slave address. How can I discover the I2C slave address?
Here is a diagram of my setup – the Aardvark adapter is the master device.
Response from Technical Support:Thanks for your question! We will start with an overview of the aai2c_file function, and then discuss how to discover the I2C slave address.
Here is an overview of calling the aai2c_file and its parameters
The callout:
The parameters:
Each slave device has a unique address to identify it on the bus. These addresses are pre-defined and are normally provided in the datasheet of the device. To identify multiple devices on the same bus, you can set the least significant bits.
In standard I2C, the slave address is 7-bits. The extended 10-bit address is also supported. For more information about I2C addresses, please refer to the article 7-bit, 8-bit, and 10-bit I2C Slave Addressing.
We recommend going through our Knowledge Base article Performing random reads with an I2C slave. This article uses the Control Center Serial Software to show examples of performing random reads via the GUI interface and using Batch Mode. The same concepts can be applied to API functions.
This article also provides an example of discovering the necessary information from a datasheet.
We hope this answers your questions. Additional resources that you may find helpful include the following:
If you have other questions about our host adapters or other Total Phase products, feel free to email us at sales@totalphase.com. You can also request a demo that is specific for your application.