I've been doing some fiddling with my own 24LC16B, and I think I have it working.
One thing to note is the upper 3 bits of the memory location form the lower 3 bits of the device address, so to access memory location 0x12C, you use the device address 0x51, rather than 0x50.
I modified your code, and it now works for me:
#include <Wire.h>
#define EEPROM_ADDR 0x50
void setup(){
Wire.begin();
Serial.begin(9600);
//Write the data
byte rdata = 33;
Wire.beginTransmission(EEPROM_ADDR);
//Wire.send(0x00); // MSB
Wire.send(0x00); // LSB
Wire.send(rdata);
Wire.endTransmission();
Serial.println(rdata);
delay(15);
//Set the memory pointer
Wire.beginTransmission(EEPROM_ADDR);
Wire.send(0x00);
//Wire.send(0x00);
Wire.endTransmission();
//Read
Wire.beginTransmission(EEPROM_ADDR);
Wire.requestFrom(EEPROM_ADDR,1);
if (Wire.available()) Serial.println(Wire.receive());
Wire.endTransmission();
}
void loop(){
}
To write you only pass it two values, one which specifies the lower 8 bits of the address, and one for data. Then, there needs to be a delay to allow the writing to happen, the data sheet says a max of 10ms, so 15ms might be longer than needed, but ensures it is definately written. Also, the requesting needs to go between its own set of begin/end transmission commands.
Here's a simple method I wrote to dump the whole EEPROM for a project of mine:
void dump()
{
Wire.beginTransmission(ADDRESS);
Wire.send(0);
Wire.endTransmission();
for ( byte upper=0; upper<=8; upper++ )
{
for ( int i=0; i<32; i++)
{
Wire.beginTransmission(ADDRESS+upper);
Wire.send(i*8);
Wire.endTransmission();
Wire.beginTransmission(ADDRESS+upper);
Wire.requestFrom(ADDRESS+upper, 8);
//Wait till we get all the bytes
while ( Wire.available()<8 ) {};
printInt(upper); Serial.print("-");
printInt(i*8); Serial.print(": ");
for ( int j=0; j<8; j++ )
{
printInt(Wire.receive()); Serial.print(" ");
}
Serial.println();
Wire.endTransmission();
}
}
}
void printInt(int i)
{
Serial.print("0x");
if ( i<16 )
Serial.print("0");
Serial.print(i, HEX);
}
HTH