I am using the Control Center Serial Software with an Aardvark I2C/SPI Host Adapter as the I2C master. Can you help me understand the difference between Master Read and Master Register Read? The Master Read command appears similar to the Sequential Read command, an I2C read with a stop – what am I missing?
Response from Technical Support:Thanks for your question! We’ll start with an overview about these two commands and then go into the details.
Here is a summary of the differences of the two Read commands:
The Master Read command simply reads the data sent by slave on the bus. The value provided in the "Number of Data Bytes" field is the maximum number of bytes the master will accept in a single transaction. The master may receive fewer bytes than are specified in this field, but not more. If a slave does not have the requested number of bytes available, the remainder of the bytes will default to 0xFF; this is due to the pull-up resistors on the bus.
The Master Register Read command follows the typical protocol to read a register on an I2C device in one operation: perform an I2C write with the register address, which is followed by a repeated start and an I2C read.
We recommend checking the datasheet of the I2C slave device and see if it follows this protocol. The implementation of Master Register Read depends upon the implementation specific to your device's data sheet. The following information is necessary when using the Master Register Read Command.
You can easily set up Master Read and Master Register Read using Control Center Serial Software. Here is an example of using the Master dialog:
This article gives an example of executing the Master Register Read Command and using batch commands to implement reading a master register.
Using the Aardvark I2C/SPI Host Adapter, How Do I a Perform "Master Register Read" in Batch Mode?
For more information about batch commands, please refer to Batch Mode section of the Control Center Serial Software User Manual
If you need more control for your setup, you can use Aardvark Software API. This article shows an example of using API to implement reading a master register:
How Do I Implement I2C Master Register Read with the Aardvark I2C/SPI Host Adapter?
For more information, please refer to the API Documentation section of the Aardvark I2C/SPI Host Adapter User Manual.
Additional resources that you may find helpful include the following:
We hope this answers your question. Want more information? You can contact us and request a demo that applies to your application, as well as ask about other Total Phase products.