This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Accessing external I2C EEPROM with Cypress EZ-USB dev kit

Hi

I'm trying to add an external EEPROM to my Cypress EZ-USB NX2LP-Flex dev kit, and accessing it using the library functions EZUSB_ReadI2C(), EZUSB_WriteI2C() and EZUSB_WaitForEEPROMWrite().

I plugged in a new 2Kbit EEPROM in the DIP socket and thought it was the only EEPROM there, and I tried reading it at address 0xA0, and was able to get all 0xFFs. I tried to write a single byte to the EEPROM with the following code:

   BYTE xdata temp1;
   BYTE xdata temp2[8];
   BOOL wrOK = FALSE;
   temp1 = 0x01;
   while (!wrOK)
      wrOK = EZUSB_WriteI2C(0xA0,0x01, &temp1);


I then read to read 8 bytes back with the following code

   EZUSB_ReadI2C(0xA0,0x08, &temp2);


Instead of getting all 0xFF except for the 1st byte, I got all 0x01.

I then realized that there are more than 1 I2C EEPROM connected to the SDA/SCL lines, so I'm wondering how do I address the correct one? And once I do that, how do I specify the memory address within the chip? I know the device address for all EEPROM starts with 1010(0xA), but I'm confused as to the later 4bits.

Thanks.

Parents
  • 3) Since my device only has 4 blocks, I can actually use A2 to allow for 4 more blocks(can be another 1KB device, or 2 512byte chips, or 4 256byte chips, etc.)?

    4) I set the actual device address of the chip by pulling A2 up/down, hence setting it's address 10101XX or 10101XX.

    ... my quick read of the datasheet seems to indicat that A2 is ignored.

    You can use whatever you want, but for certainity of supply I would use an EEPROM with standard format (I use Ramtron - yes single supplier but, since the access format is standard, I can use any similar EEPROM in a pinch, just do not get the resiliance (which I can live without, but prefer and like)).

    Erik

Reply
  • 3) Since my device only has 4 blocks, I can actually use A2 to allow for 4 more blocks(can be another 1KB device, or 2 512byte chips, or 4 256byte chips, etc.)?

    4) I set the actual device address of the chip by pulling A2 up/down, hence setting it's address 10101XX or 10101XX.

    ... my quick read of the datasheet seems to indicat that A2 is ignored.

    You can use whatever you want, but for certainity of supply I would use an EEPROM with standard format (I use Ramtron - yes single supplier but, since the access format is standard, I can use any similar EEPROM in a pinch, just do not get the resiliance (which I can live without, but prefer and like)).

    Erik

Children
No data