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 How to Order
Products Blog Sales Support Contact Search

How Do I Write and Read from Different Registers of an I2C Device?

Published: 2020-04-23 Updated: 2026-06-01
Rena Ayeras

Question from the Customer:

I am using the Aardvark I2C/SPI Host Adapter with an I2C device and need to access specific registers. For example:

  • Write data to register 0x02
  • Read data from register 0x03

What is the best way to do this?

Response from Technical Support:

Thanks for your question! For register-level I2C communication, we recommend using our free Control Center Serial Software in Batch Mode, which allows you to create custom XML scripts for I2C transactions..

Using Control Center Serial Software To Read/Write to I2C Registers

When using the GUI dialog, register reads are simplified by automatically combining the I2C write and read transactions into a single operation. While this makes basic register reads easy, it does not support writing to one register and then reading from a different register.

Batch Mode gives you full control over the I2C transactions, allowing you to create custom sequences such as writing to one register address and reading from another.

Read/Write Registers in Batch Mode

For example, to read 4 bytes from register 0x11 on an I2C device with slave address 0x55, you can do the following:

<i2c_write addr="0x55" count="1" nostop="1" radix="hex">11</i2c_write> 

<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:
<START><I2C_SLAVE_ADDR with WR_CMD><REGISTER_OFFSET><WR_DATA0><WR_DATA1>...<STOP>
Master Register Read:
<START><I2C_SLAVE_ADDR with WR_CMD><REGISTER_OFFSET><REPEATED_START><I2C_SLAVE_ADDR with RD_CMD><RD_DATA0><DATA1>...<STOP>

 

Control Center Serial Software displays a transaction log showing the exact I2C traffic sent on the bus. Comparing this log with your device's datasheet can help verify that the communication sequence matches the device's requirements.

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 the following video to learn more about using Batch Mode, which demonstrates how to create XML scripts and view the resulting 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.

Request a Demo