Site Index
   Home
   File Upload
Google

Transfer Site
Main Site

EVM5502 I2C EEPROM Module

This module reads and writes to the Catalyst CAT24WC256 EEPROM on the EVM5502. The I2C bus is used for communication with the EEPROM. Since the EEPROM is accessed through an independent serial interface, it is not mapped into the EMIFÆs address space. Therefore, addresses are logical offsets from the beginning of the device.

Name Typical Value Description
EVM5502_EEPROM_BASE 0x000000 Address of start of EEPROM
EVM5502_EEPROM_SIZE 0x8000 Total size of EEPROM

Function Description
EVM5502_EEPROM_read Read data from a range in EEPROM.
EVM5502_EEPROM_write Write data to a data range in EEPROM.

EVM5502_EEPROM_read()

Description
Read data from a range in Flash

Required Headers
evm5502.h
evm5502_eeprom.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_EEPROM_read(Uint32 src, Uint32 dst, Uint32 length)

Parameters
src - Address of EEPROM to read from. Given as an integral number of 8-bit bytes.
dst - Address to memory to read to. Given as an integral number of 16-bit words. Source is assumed to have 8-bits of valid data stored in the low byte of each 16-bit word.
length - Length of transfer, in 8-bit bytes.

Return Value
None

Example

    Uint16 buf[256];

    /* Copy 256 16-bit words from 
     * the beginning of the EEPROM to buf */
    EVM5502_EEPROM_read(0, (Uint32)buf, 256);

EVM5502_EEPROM_write()

Description
Write data to a data range in Flash. The Flash must be erased first.

Required Headers
evm5502.h
evm5502_eeprom.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_EEPROM_write(Uint32 src, Uint32 dst, Uint32 length)

Parameters
src - Address of memory to read from. Given as an integral number of 16-bit words. Source is assumed to have 8-bits of valid data stored in the low byte of each 16-bit word.
dst - Address to EEPROM to write to. Given as an integral number of 8-bit bytes.
length - Length of transfer in bytes

Return Value
None

Example

    Uint16 buf[256];

    /* Copy 256 16-bit words from 
     * buf to the beginning of EEPROM */
    EVM5502_EEPROM_write((Uint32)buf, 0, 256);
©Copyright 2002-2011 Spectrum Digital, Inc. All Rights Reserved.