Write to external eeprom

I'm trying to use the playground's tutorial to write data to an external eeprom...an AT24C1024BW. I'm using a mega1280 with a bootloader on a non-arduino clone board.

The eeproms A1,A2,A3 were left floating as was the wp pin since the datasheet said that the internal pullups would pull them to ground.

I'm using 0x50 for the eeprom's address and sending the data from Processing....

If I leave out the call to saving bytes to the eeprom all goes well. When I send the data to the eeprom every thing stops. I've put a flash routine in the mega to show when bytes were written. It never flashes. I've put print statements in Processing to show the "ok" sent back from the mega. It only gets one "ok" the one first sent by the mega to show it's ready to receive.

mega's (short) code:

#define BytesToWrite 16
byte pwmLevels[BytesToWrite];
int col, row;
unsigned int eepromPos=0;

void setup(){
  flash13(9,50);
  Serial.begin(19200);
  Serial.print("ok");//Processing waits to get the "ok" 
}

void loop(){
  if (Serial.available() >= BytesToWrite){
    flash13(1,50);
    for (int i=0; i<BytesToWrite; i++){
      pwmLevels[i] = Serial.read();
      //pwmLevels[i] = c;
    }
    /*for (int i=0; i<BytesToWrite; i++){
      Serial.print(pwmLevels[i],DEC);
      Serial.print(" ");
    }**/
      // 0x50 is the eeprom's address if pins 1,2,3 are tied to ground or left floating.
    //i2c_eeprom_write_byte( 0x50, eepromPos, c );//one byte at a time
    i2c_eeprom_write_page( 0x50, eepromPos, pwmLevels, BytesToWrite );
    eepromPos += BytesToWrite;
//    delay(5);//allow eeprom to save buffered bytes
    flash13(1,50);
    Serial.print("ok");//"Processing" waits to get the "ok".

  }
}

void flash13(int howManyTimes, int delayTime){//flash the led on pin13
  for(int i=0;i<howManyTimes;i++){
    digitalWrite(13,HIGH);
    delay(delayTime);
    digitalWrite(13,LOW);
    delay(delayTime);
  }//show the world we got here
}

Processing's (also short) code:

import processing.serial.*;
// used to send the mega bits of data to the arduino mega

Serial serialPort;

byte[] ByteShades = new byte[131072];
int ndxVar=0;//+- 2,147,483,648
String inString = "";
int BytesToSend = 16;
int lf=10;
PFont myFont;

void setup() {
  size(500,200);
  myFont = loadFont("BitstreamVeraSans-Bold-18.vlw");
  textFont(myFont, 18);
  serialPort = new Serial(this, "/dev/ttyUSB1", 19200);//"/dev/ttyUSB2"
  //println("/dev/ttyUSB1");
  ByteShades = loadBytes("Shades.dat");
  serialPort.bufferUntil('k');
}

void draw() {
  background(0);

  if(inString.equals("ok")){
    println(inString);
    inString="";
    sendBytes();
  }
  text("Sent: " + ndxVar+" bytes", 10,50);
}

void sendBytes(){
  for(int j = 0; j < BytesToSend; j++){
    serialPort.write(ByteShades[ndxVar]);
    ndxVar++;
    //print(ByteShades[ndxVar]+" ");
  }
  println("");
}

void serialEvent(Serial p) {
  inString = (serialPort.readString());
}

Anyone like to see if they can make it work? I've tried for several days with no luck. I'm wondering if changes need to be made to the wiring library to make the mega1280 compatible. It could be the internal pulldowns aren't setting the correct address. I could bridge the pins to ground. Hate to, it looks nice right now!

I just noticed, without looking at the code, that you said you left A1, A2, A3, WP unconnected. (A1, A2, A3 are the address pins.)
First thing I would do is to connect them to ground. This is tested and works, see this schematic:
Imgur

Thanks for the reply...I'm using the mega1280 not the 328 and the eeprom is the AT24C1024BW not the 24LC256. The eeprom's datasheet says you can leave them floating. The datasheet for the 245LC256 says the same thing.

I'm afraid it's the wiring library. There's some comments in it that make me believe there's some difference.

If no further information is posted, I'll try grounding the pins. Hate soldering!

Your picture calls it a smart clock.....so it's a clock.
What do you store in the eeprom?

The external eeprom stores quotations, "1-liner"s.
The internal eeprom stores font definition.
See this post: Wise time with Arduino: Wise Clock