I2C SPI USB CAN eSPI Cable Testing View All Quick Start Guides User Manuals Software Downloads Knowledge Base Videos Case Studies App Notes White Papers Sales Support About Us
Products Blog Sales Support Contact Search
What is the Difference between Master Register Read and Master Read, and How Can I Best Implement those Commands?
Rena Ayeras

Question from the Customer:

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.

Control Center Serial Software Read Commands

Here is a summary of the differences of the two Read commands:

  • The Master Read command performs an I2C bus read operation.
  • The Master Register Read command performs an I2C bus write operation without stop, and then performs the I2C bus read operation.

Master Read Command

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.

Master Register Read Command

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.

  • Register Address, which is different from the I2C slave address, can be entered in either decimal or hexadecimal notation. If using hexadecimal notation, preface the number with "0x".
  • Address Width specifies the size of the register address in bytes. If the provided Register Address exceeds this width, the least significant bytes of the Register Address will be used.
  • Number of Data Bytes specifies the number of bytes the adapter will attempt to read from the I2C slave. The adapter may receive fewer bytes than are specified in this field, but not more. Similar to the Master Read command, if the slave device does not have the requested number of bytes available, the remainder of the bytes will default to 0xFF due to the pull-up resistors on the bus.

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:

Control Center Serial Software Dialog for Master Write and Master Register Write

Examples of Executing Read Commands

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.

Request a Demo