Using the I2C Bus to Access a Connected EEPROM

This example shows how to use the I2C blocks to access an EEPROM connected to the chip using the I2C bus.

Required Hardware:

Note: Any C2000 (except c281x) controlSTICK or ControlCARD with Docking Station board is not equipped with I2C EEPROM. You must add I2C EEPROM to this board to run the example.

Available versions of this example:

Contents

Model

The following figure shows the example model.

Description

This example shows how to access the EEPROM connected to the I2C bus at I2C slave address 0x50 on an F2808/F28335 eZdsp board.

This program writes 4 bytes to EEPROM and reads back the data from the corresponding EEPROM address to show successful communication.

The I2C Transmit block in the "EEPROM Write" subsystem writes the free-running counter data from the "EEPROM Data" subsystem to the address specified by "EEPROM Memory Addr" subsystem.

When an I2C interrupt is detected, "I2C SYS INTR" subsystem function is executed. As a result, the I2C Receive block reads the EEPROM data in "I2C SYS INTR:ARDY Subsystem:Subsystem". The global array "EEPROM_DATA" contains the received data. You can monitor the value of this array in Code Composer Studio™ Watch Window.

How to Run the Example

The following sections explain how to configure, build, and deploy the executable.

With Code Composer Studio v3.3 (CCSv3.3) - Default

With Code Composer Studio v4 (CCSv4)

CCSv4 support is provided via a makefile based approach. This requires running xmakefilesetup to set the environment. You can ignore the following if you have already gone through these steps. For more information, please refer to the Xmakefile Documentation

  1. C:\Program Files\Texas Instruments\ccsv4\ for CCS Installation.
  2. C:\Program Files\Texas Instruments\ccsv4\tools\compiler\C2000\ for Code Generation Tools.
  3. C:\Program Files\Texas Instruments\bios_5_41_10_36\ for DSP/BIOS Installation.

Code Generation and Creation of an .out file using CCSv4:

With Code Composer Studio v5 (CCSv5)

CCSv5 support is provided via a makefile based approach. This requires running xmakefilesetup to set the environment. You can ignore the following if you have already gone through these steps. For more information, please refer to the Xmakefile Documentation

  1. C:\ti\ccsv5\ for CCS Installation.
  2. C:\ti\ccsv5\tools\compiler\c2000\ for Code Generation Tools.
  3. C:\ti\bios_5_41_11_38\ for DSP/BIOS Installation.

Code Generation and Creation of an .out file using CCSv5: