How to read The Whole External EEProm chip?

Hello, I'm trying to find a way to read a whole EEprom chip of 2kb 24C02W6 by ST Micro. I'm about to see one I guess you call it block by block. Or section by section. But I would like to read Everything that is on there. I just do not know I can do that. I don't know how mant bytes are written or how much is on there. The example sketch below is what i found online. Does anyone know a way how I can read the whole EEprom please? I do not want to write over anything because this EEprom belongs to mhy friend it come from his server raid controller. I'm able to read the address thought i2c scanning but that is all.

#include <Wire.h>    
 
#define disk1 0x54    //Address of 24LC256 eeprom chip
 
void setup(void)
{
  Serial.begin(9600);
  Wire.begin();  
 
  unsigned int address = 0;
 
 // writeEEPROM(disk1, address, 123);
  Serial.print(readEEPROM(disk1, address), DEC);
}
 
void loop(){}
 
void writeEEPROM(int deviceaddress, unsigned int eeaddress, byte data ) 
{
//  Wire.beginTransmission(deviceaddress);
//  Wire.write((int)(eeaddress >> 8));   // MSB
//  Wire.write((int)(eeaddress & 0xFF)); // LSB
//  Wire.write(data);
//  Wire.endTransmission();
 
  delay(5);
}
 
byte readEEPROM(int deviceaddress, unsigned int eeaddress ) 
{
  byte rdata = 0xFF;
 
//  Wire.beginTransmission(deviceaddress);
//  Wire.write((int)(eeaddress >> 8));   // MSB
//  Wire.write((int)(eeaddress & 0xFF)); // LSB
//  Wire.endTransmission();
 
  Wire.requestFrom(deviceaddress,254);
 
  if (Wire.available()) rdata = Wire.read();
 
  return rdata;
}

Joseph

RV mineirin

Hello, I'm looking at it now. I will do a follow up shortly Thank you.

Joseph

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.