External Eeprom - Information

Good Afternoon,
for my project i was thinking to implement external eeprom instead of arduino eeprom because I have at disposition 1.000.000 of write cycle instead of 100.000.

then before to write a post (how ever I’ve tried to look inside google) and I’ve found this: topic

#include <Wire.h>    
#define disk1 0x50    //Address of 24LC256 eeprom chip
void setup(void)
  unsigned int address = 0;
  writeEEPROM(disk1, address, 123);  // eeprom is at the 0x50, add of memory 0 and data 123
  Serial.print(readEEPROM(disk1, address), DEC);
void loop(){}
void writeEEPROM(int deviceaddress, unsigned int eeaddress, byte data ) 
  Wire.write((int)(eeaddress >> 8));   // MSB
  Wire.write((int)(eeaddress & 0xFF)); // LSB
byte readEEPROM(int deviceaddress, unsigned int eeaddress ) 
  byte rdata = 0xFF;
  Wire.write((int)(eeaddress >> 8));   // MSB
  Wire.write((int)(eeaddress & 0xFF)); // LSB
  if (Wire.available()) rdata = Wire.read();
  return rdata;

This line of code what are means ?:

  Wire.write((int)(eeaddress >> 8));   // What are means ?
  Wire.write((int)(eeaddress & 0xFF)); // What are means ?

and this

  Wire.write((int)(eeaddress >> 8));   //   What are means ?
  Wire.write((int)(eeaddress & 0xFF)); // What are means ?

  Wire.requestFrom(deviceaddress,1);  //What are means ?

Looking the example is not more easy like write and read Arduino Eeprom … so my question is:

Is there some library that I can use in order to use “external eeprom” easily as “arduino eeprom” ?

Thanks 10000 for support,

External EEPROM is typically accessed via an SPI or I2C interface. Your example appears to be using I2C interface: #include <Wire.h>
Both send out addresses and data as 8-bit numbers (a byte).

This a 16 bit address
unsigned int address = 0;

This breaks it up into 2 bytes and sends it out:

Wire.write((int)(eeaddress >> 8 )); // If the address was 0x1234, this shifts the 12 over 8 bit positions and sends it out
Wire.write((int)(eeaddress & 0xFF)); // This masks off the 12, so that only 34 is left and sends it out.

Another way to perform this would be:

This is setting up the address that will be read from.

This tells the device to send 1 byte. deviceaddress will be the EEPROMs I2C bus address; typically the lowest bit of the address will be 0 or 1 to tell the device a read or write is occurring;
Wire.requestFrom(deviceaddress,1); //What are means ?

Wire.write(data); will send data to the device

Wire.read(); will read the data the device sends

this link will help you understand what's going on here;


That link only helps for the >> 8 question. The main question was understanding I2C operation.