How Exactly Does Master Read Differentiate from Master Register Read?

A picture of looking at data and reference books.

Photograph by Dmitriy

Question from the Customer:

I am using the Aardvark I2C/SPI Host Adapter as an I2C master to check the data transactions of an EEPROM of a new script. I am not familiar with the Master Read and Master Register Read function, and I do not understand how they operate. Can you provide details about the differences of those commands and how they work?

Response from Technical Support:

Thank you for your question!  The Master Register Read function is a simple way of using the Master Read function to get data from a specific location in the EEPROM. We will describe how it works, including the related write functions.

How Register Write and Resister Read Work

The register write can be accomplished with a single write command from the Aardvark master I2C device. In this case, only acknowledgement is expected from the slave device. Here is an example of sending data 04 19 to write to register location 0x12

12 04 19

    • 12 is the register location
    • 04 19 is the data

For I2C components, the first byte is typically the register or memory address. For some components, the memory address consists of the first two bytes. For details of the memory address and more, refer to the datasheet of the device that you are using.

Read and Write Pointers

A single read/write pointer is usually applied with the smallest EEPROM chips. Here is a summary of how this works:

  1. The first byte of any write operation sets the pointer.
  2. Any subsequent read or write operation starts from the location of the pointer.
  3. The pointer is incremented after a single byte operation is applied.

For example, you would implement a single Master Write operation as <start> <i2c_addr> <mem_addr> <byte1> <byte2> <byte3> <byte5> <i2c stop>. In this case, five bytes of data payload on I2C writes four bytes to the EEPROM starting at the specified memory address. After that operation, the internal pointer is incremented to byte6. The next I2C read operation will retrieve byte6.

Master Register Read Shortcut

The Master Register Read function is like a shortcut for all the actions described above. With this single command, you can achieve the same result as using two commands, Master Write followed by Master Read.

To better understand Master Register Read, please refer to How to Read and Write to an I2C EEPROM Using the Aardvark adapter and Control Center. This article provides more information about the read and write functions, and includes a detailed example that you can execute and view the results within the Control Center Serial Software.

We hope this answers your question. 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.