eeprom having multiple i2c addresses

peace all , being new to arduino , i wanted to use an epprom (k24c08c) my problem is the i2c scanner shows 4 i2c addresses and i couldn't make any operation on the chip exteeprom or i2cepprom libraries do not work can someone help me out ?

There are subtle differences to the way some diifferent types of EEPROM work.

Unless you can find a library for the k24c08c, or want to write your own, it would be a lot easier and much quicker just to use an EEPROM that is supported by the libraries you mention.

24LC256s for instance are very low cost.

Read the datasheet, 2 of the address bits are used to specify the two high bits of the address you’re reading or writing to/from.

On 16kbit sizes, 3 of the address bits are used. For larger sizes up to 512kbit, 2 bytes are used for addressing. For larger sizes, they again use the address bits for addressing

The 8K EEPROM only uses the A2 device address bit with the next 2 bits being for memory page addressing. The A2 bit must compare to its corresponding hard-wired input pin. The A1 and A0 pins are no connect.

Let us connect A2-pin to 0V (GND) and A1-A0 pins open circuited. Execute the Address Scan Program. The Chip should be detected at address 0x50. Is it correct? (Serial EEPROM Address: 1010A2A1A0).

thx all

DrAzzy: Read the datasheet, 2 of the address bits are used to specify the two high bits of the address you're reading or writing to/from.

On 16kbit sizes, 3 of the address bits are used. For larger sizes up to 512kbit, 2 bytes are used for addressing. For larger sizes, they again use the address bits for addressing

so A2 A1 A0 should be connected to ground right?

GolamMostafa: Let us connect A2-pin to 0V (GND) and A1-A0 pins open circuited. Execute the Address Scan Program. The Chip should be detected at address 0x50. Is it correct? (Serial EEPROM Address: 1010A2A1A0).

the i2c program still gives me this i2c scanner. scanning ... Found address : 80(0x50) Found address : 81(0x51) Found address : 82(0x52) Found address : 83(0x53) Done.Found 4 device(s).

The 10-bit register address is split into two parts. The highest bits are in the I2C address and the next byte (when writing) is the remaining 8 bits. You need a special library for that, or write it yourself.

I agree with srnet, buy a normal common EEPROM.

Koepel: The 10-bit register address is split into two parts. The highest bits are in the I2C address and the next byte (when writing) is the remaining 8 bits. You need a special library for that, or write it yourself.

I agree with srnet, buy a normal common EEPROM.

can u tell me how can i send a 10 bit address then ? thx

0x50 for 00xxxxxxxx 0x51 for 01xxxxxxxx 0x52 for 10xxxxxxxx 0x53 for 11xxxxxxxx

septillion: 0x50 for 00xxxxxxxx 0x51 for 01xxxxxxxx 0x52 for 10xxxxxxxx 0x53 for 11xxxxxxxx

sorry to bother you , my problem right now is to use wire.write to send read or right command

Just think of the 10-bit EEPROM as 4 separate 8-bit EEPROMS.

Write

Wire.beginTransmission(0x50); Address of "first" EEPROM
Wire.write(0x10); //address 0x10 IN that EEPROM
Wire.write(0x42); //Write the value of 0x42 to that selected address
Wire.endTransmission(); // and end

Read

Wire.beginTransmission(0x50); Address of "first" EEPROM
Wire.write(0x10); //address 0x10 IN that EEPROM
Wire.endTransmission(false); // end the writing part but don't stop transmission
Wire.requestFrom(0x50, 1); Request 1 byte from the "first" EEPROM
byte dataRead = Wire.read();

septillion: Just think of the 10-bit EEPROM as 4 separate 8-bit EEPROMS.

Write

Wire.beginTransmission(0x50); Address of "first" EEPROM
Wire.write(0x10); //address 0x10 IN that EEPROM
Wire.write(0x42); //Write the value of 0x42 to that selected address
Wire.endTransmission(); // and end

Read

Wire.beginTransmission(0x50); Address of "first" EEPROM
Wire.write(0x10); //address 0x10 IN that EEPROM
Wire.endTransmission(fale); // end the writing part but don't stop transmission
Wire.requestFrom(0x50, 1); Request 1 byte from the "first" EEPROM
byte dataRead = Wire.read();

thk you so much it worked ( i fried a nano in the process -_- )

septillion: Just think of the 10-bit EEPROM as 4 separate 8-bit EEPROMS.

In the light of the above proposition, we may come up with the following conceptual view of the k24c08c EEPROM of capacity 8 kBits (1024 bytes -----> 1024 byte locations = 4 x 256 byte locations). |500x348

In the 24CXXX series, there is no such split concept. What is the advantage of incorporating this split concept for k24c08c EEPROM where we see an apparent wastage of slave addresses?

GolamMostafa: In the light of the above proposition, we may come up with the following conceptual view of the k24c08c EEPROM of capacity 8 kBits (1024 bytes -----> 1024 byte locations = 4 x 256 byte locations). |500x348

In the 24CXXX series, there is no such split concept. What is the advantage of incorporating this split concept for k24c08c EEPROM where we see an apparent wastage of slave addresses?

excellent question , i might add that changing the device address (0x50 to 0x51 for example) doesn't grant access to the second virtual eeprrom...at least i got access to 256 bytes from the 0x50

GolamMostafa: In the light of the above proposition, we may come up with the following conceptual view of the k24c08c EEPROM of capacity 8 kBits (1024 bytes -----> 1024 byte locations = 4 x 256 byte locations).

Its more the way it is rather than conceptual.

The blocks of EEPROM memory are at different I2C addreses.

Low byte count FRAMs are the same, the 2Kbyte devices are 256byte pages at different I2C addresses.

koufdell: excellent question , i might add that changing the device address (0x50 to 0x51 for example) doesn't grant access to the second virtual eeprrom...at least i got access to 256 bytes from the 0x50

Try the following codes to perform 1-byte read/write operation with EEPROM-1 Block:

Wire.beginTransmission(0x51);
Wire.write(0x00);                       //uper byte of address of an EEPROM location
Wire.write(0x10);                      //lower byte of address of the above EEPROM location
Wire.write(0x67);                      //data for the above EEPROM location
Wire.end.Transmission();

do       //check that write cycle is done; although, this EEPROM finishes writing at the speed of bus cycle
{
   Wire.beginTransmission(0x51);
   byte busStatus = Wire.endTransmission();
}
while(busStatus !=0x00);

Wire.beginTransmission(0x51);
Wire.write(0x00);                       //uper byte of address of an EEPROM location
Wire.write(0x10);                      //lower byte of address of the above EEPROM location
Wire.end.Transmission();

Wire.requestFrom(0x51, 1);

byte x = Wire.read();     // x = 0x67

GolamMostafa: In the 24CXXX series, there is no such split concept. What is the advantage of incorporating this split concept for k24c08c EEPROM where we see an apparent wastage of slave addresses?

This is untrue.

ALL of the 24-series EEPROMs have the same behavior, depending on the size of the eeprom. In cases where the address bits are used for addressing, you basically treat it as multiple EEPROMs.

If the addressing requires 8 or fewer bits, the address bytes are not used for addressing. This goes up to 256 bytes (2 kbit) .

If the addressing requires 9, 10, or 11 bits, 1, 2 or 3 of the bits of the device address are used to address the byte to be accessed. This means that the corresponding A# pins are not available.

If the addressing requires 12~16 bits, two bytes are used for the memory address, and the device address is not used for the memory address. This is applicable to eeproms from 32 kbit (4kb) ~ 512 kbit (64kb).

If the addressing requires 17~19 bits, again, 1, 2 or 3 bits of the device address are used to address the byte being accessed - this applies to 1mbit (128kb), 2mbit (256kb) and 4mbit (512kb) devices - though I don't think they make 4mbit ones.

This is how it works for all 24-series and compatible EEPROMs (and the FRAMs that implement the same interface). An AT24C08 works the same way as the K24C08.

DrAzzy: This is how it works for all 24-series and compatible EEPROMs (and the FRAMs that implement the same interface).

Yes, some of the FRAMs work this way too.

I needed to use a low cost one, 16Kbits, for a series of projects. The device presents as 8 seperate devices of 256 byes each.

I did need to write my own library, which is why I made the comment that it was not worth the effort to change a library to suit a particular device, particullarly as a device that is know to work is around 50c.