Introduction
Programming I2C memory devices is a common use case for the Aardvark I2C/SPI Host Adapter and level shifter board. There are several ways to do this with the Aardvark adapter, including using Control Center, Flash Center, or the Aardvark API. This article focuses on how to take the information in an EEPROM datasheet and execute the commands in Control Center. This article also shows how to use the level shifter board in order to supply low voltage level to the I2C EEPROM. Although the following describes the Microchip 24FC512 I2C EEPROM with the EEPROM Socket Board, similar steps can be used for other devices. The goal of this article is to demonstrate how to write several bytes to a specific address and then read back those bytes.
Overview
In this article the Aardvark adapter is the I2C master and the I2C EEPROM 24FC512 in the EEPROM socket board is the I2C slave. The Aardvark is connected to the 24FC512 1.8V SOIC-8 in the EEPROM socket board through the level shifter board. The level shifter board converts the Aardvark 3.3V I2C signals and 5V VDD signal to 1.8V I2C signals and 1.8V VDD signal. For additional information take a look at Figure 1: Aardvark and 24FC512 Block Diagram, level shifter board user manual, and EEPROM socket board user manual.
Figure 1: Aardvark and 24FC512 Block Diagram
24FC512 Details
The 24FC512 I2C EEPROM on the EEPROM socket board has a hardware configurable I2C target address. The default I2C target address is 1010000b, which is 0x50. This article uses the default I2C target address 0x50. For additional information take a look at Figure 2: 24FC512 Control Byte Format and knowledge base article 7-bit, 8-bit, and 10-bit I2C Slave Addressing.
Figure 2: 24FC512 Control Byte Format
The I2C EEPROM on the EEPROM socket board receives the I2C pulls-ups and power from the Aardvark adapter. In order to supply the I2C pull-ups and target power to the I2C EEPROM on the EEPROM socket board, the Aardvark adapter should be configured to I2C pull-ups enabled and target power enabled. For additional information take a look at the EEPROM socket board user manual.
The 24FC512 write operation used here is Page Write. The Page Write operation to the 24FC512 requires 7 bit device address, two byte memory address, and two or more bytes of memory data. Performing a memory write operation with the Aardvark adapter requires a single command from the adapter and Control Center. In this case, the Control Center "Master Write" command includes the device address (0x50), memory address (0x0008), and memory data (0x0A 0x0B 0x0C).
Figure 3: 24FC512 Page Write
The 24FC512 read operation used here is the Sequential Read. The 24FC512 Sequential Read operation first performs I2C write with 7 bit device address, two byte memory address and no stop. Then the 24FC512 Sequential Read operation performs I2C read with 7 bit device address, two or more bytes of memory data, and stop. Performing a memory read operation with the Aardvark adapter requires a single command from the adapter and Control Center. In this case, the Control Center "Master Register Read" command includes the device address (0x50), memory address (0x0008), address width (2 bytes), and number of data bytes (3). For additional information take a look at the 24FC512 datasheet.
Figure 4: 24FC512 Sequential Read
Writing and Reading Guidelines
- Download and run the latest version of the Total Phase USB Drivers Installer.
- Download and unzip the latest version of Control Center. (?)
- Connect the Aardvark adapter USB connector to the PC USB connector.
- Connect the Aardvark adapter I2C/SPI connector to the level shifter board ADAPTER connector as shown in Figure 7. On level shifter board install jumpers on TPWR, 1.8V, and MASTER.(?)
- Connect the level shifter board TARGET1 connector to the EEPROM socket board Aardvark1 connector as shown in Figure 8. On the EEPROM socket board install jumpers on VDD SOURCE: 5V, J3, and J4: 1&2. On EEPROM socket board install wires on (?):
- J6 – 1 to J5 – 1 (White, GND)
- J6 – 2 to J5 – 2 (Purple, GND)
- J6 – 3 to J5 – 3 (Blue, GND)
- J6 – 4 to J5 – 4 (Green, GND)
- J7 – 1 to J9 – SDA (Yellow)
- J7 – 2 to J9 – SCL (Orange)
- J7 – 3 to J5 – 5 (Red, GND)
- J7 – 4 to J10 – 1 (Brown, VDD)
- Launch Control Center. (?)
- Connect Control Center to the Aardvark adapter. (?)
- Click Configure Aardvark Adapter.
- Select the Aardvark Adapter.
- Click OK to connect to the adapter.
- Click Aardvark, and choose I2C+SPI.
- Click Aardvark, and enable I2C Pulls-Ups and Target Power. (This configuration is required for the level shifter board, and EEPROM socket board, but may not be required for all target systems.)
- Configure the adapter as an I2C Master using the I2C Control panel. (?)
- Click on the Master tab.
- Enter 800 in Bitrate rectangular, and click Set.
- Enter 0x50 in Slave Address field.(?)
- Disable 10 Bit Addr and No Stop.
- Write 0A 0B 0C to 24FC512 in memory address 00 08.
- Enter 00 08 0A 0B 0C in the Message field, and click Master Write.
- Read 0A 0B 0C from 24FC512 in memory address 00 08.
- Enter 0x0008 in Register Address
- Select 2 bytes in Address Width
- Enter 3 in Number of Data Bytes
- Click Master Register Read, and verify that the read data is 0A 0B 0C.
Figure 5: Aardvark Programs 24FC512
Figure 6: Programing System
Figure 7: Level Shifter Board
Figure 8: EEPROM Socket Board
Notes
For additional information, take a look at the Aardvark adapter user manual, Control Center user manual, level shifter board user manual, and EEPROM socket board user manual.