How Do I Program a Standard I2C Device that Is More than Non-Volatile Memory?

Chips on a printed circuit board.

Photo by CristianIS

Question from the Customer:

We are looking for an I2C Flash programmer, and are reviewing the specifications of your Aardvark I2C/SPI Host Adapter . We see your adapter can program Flash memory devices. Can it also program Flash memory on ASIC devices, such as the Microchip DAC MCP47CMBXX? This DAC is more than a non-volatile memory chip. It has an on-chip Flash memory and I2C interface pins.

Here is the command/data flow for a single write to non-volatile memory on the DAC:

Diagram of data flow for single write to DAC device

It looks like your Flash Center Software can send a slave address (SA) in the Control Byte, but what about a DAC-specific write command? How could that command be created and sent to the DAC?

Response from Technical Support:

Thanks for your question! the Aardvark adapter uses standard I2C, which enables it to program any device that conforms to the standard. As long as the Microchip DAC conforms to standard I2C, the Aardvark adapter can program it. However, the Flash Center Software is designed for standard memory devices. For devices such as the DAC, we recommend using Aardvark Software API to create a custom script for direct communication.

How API Programs Memory Devices

The API examples in the Aardvark Software API package are functional scripts that can be used as is, or modified as needed for your device specifications. One script, aai2c_eeprom, is for reading from or writing to an I2C serial EEPROM. Note: This example is based on the specifications of Atmel AT24C02 on the I2C/SPI Activity Board.

Here is a summary of the function API scripts:

  • aadetect Detect Aardvark devices attached to the system.
  • aalights Flash LEDs attached to a Philips PCA9554D I/O port expander as found on the Activity Board.
  • aai2c_eeprom Read from or write to an I2C serial EEPROM, such as the Atmel AT24C02 on the Activity Board.
  • aaspi_eeprom: Read from or write to an SPI serial EEPROM, such such as the Atmel AT25080A on the Activity Board.
  • aai2c_file and aai2c_slave: Demonstrate the I2C slave functionality of the Aardvark device. Note: This example requires two Aardvark devices. First, run aai2c_slave with the first Aardvark device to wait for a new slave transmission. Then, in another shell, run aai2c_file to transmit a binary file with the second Aardvark device.
  • aaspi_file and aaspi_slave: Demonstrate the SPI slave functionality of the Aardvark device. Note: This example requires two Aardvark devices. First, run aaspi_slave with the first Aardvark device to wait for a new slave transmission. Then, in another shell, run aaspi_file to transmit a binary file with the second Aardvark device.
  • aagpio: Perform simple GPIO tests with a single Aardvark adapter. The results can be verified with an oscilloscope or a multimeter.
  • aamonitor: Demonstrate the I2C Bus Monitor feature. This example can be run on one Aardvark while using a second Aardvark to communicate with the I2C EEPROM on the Activity Board (see aai2c_eeprom). The first Aardvark monitors the traffic between the second Aardvark and the EEPROM.

For more information about API functionalities, please refer to the API documentation section of the Aardvark I2C/SPI Host Adapter User Manual.

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.