Erasing external I2C EEPROM

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have been trying to erase an external AT24C64 I2C EEPROM chip using AVRlib's I2C library, without success.

The WP line is low and I have been able to get some data into the part and back out again.

However, to start at a known state I want to do the following:

// initialise entire contents of the EEPROM to ZERO one byte at a time
   for(int_erase_memory_address = 0; int_erase_memory_address < 8192; int_erase_memory_address++)
   {
      zero[0] = (u08)((int_erase_memory_address >> 8) & 0x00FF);
      zero[1] = (u08)(int_erase_memory_address & 0x00FF);
      zero[2] = 0;
      
      while(retval != 0x00)
      {
         retval = i2cMasterSendNI(EEPROM_ADDR, 3, zero);
      }   
   }

Even checking the return value does not produce a clean EEPROM.

Could someone please spot the mistake?

Thanks heaps,
davef

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Appears on a successful write that retval has a value of 0x08 instead 0x01 as defined in i2c.h (AVRlib).

Leaving the test out allows me to erase the EEPROM again.