You can batch program devices using the Aardvark I2C/SPI Host Adapter and any of the following applications: the Control Center Software, the Flash Center Software or the Aardvark Software API. Following is a summary of the example provided in our latest knowledge base article, Programming I2C EEPROM using Aardvark Adapter and Control Center Batch Mode. With some modification, this example be used for programming other devices.
This setup of this example:
Initial Configuration
The Aardvark provides the I2C pull-ups and target power to the memory device on the Activity board. The batch command for this configuration will be as follows:
<configure i2c="1" spi="1" gpio="0" tpower="1" pullups="1">
Writing and Reading to the Device
For the AT24C02 memory device, the write operation will be Page Write and the read operation will be Sequential read.
Write
The default I2C target address is 0x50. For Page Write, AT24C02 requires a 7-bit device address, one byte memory address, and two or more bytes of memory data. For information about programming a 7-bit device, please refer to the knowledge base article 7-bit, 8-bit, and 10-bit I2C Slave Addressing.
In this example, the commands for writing 256 bites will be as shown below. Note - this example represents the first and last i2c_write commands used for writing 256 bytes of data.
<i2c_write addr="0x50" count="2" radix="16">00 00</i2c_write>
<i2c_write addr="0x50" count="2" radix="16">FF FF</i2c_write>
Read
The AT240C Sequential Read operation uses two commands: i2c_write following by i2c_read. In this example, the read commands will be as follows:
<i2c_write addr="0x50" count="1" radix="16" nostop="1">00</i2c_write>
<i2c_read addr="0x50" count="256"/>
About the write command parameters:
About the read command parameters:
Writing to the Device Using Batch Mode:
Reading from the Device Using Batch Mode:
For more information, please refer to the following documents:
If you have questions about our host adapters or other Total Phase products, feel free to email us at sales@totalphase.com or submit a request for technical support.