SPI EEPROM Interface with my Arduino

Hi All,
First of all I cant (or) not access our forum for few days Sorr.(Because I went to interview).
Ok.
Lets gets started.

Experiment:
SPI EEPROM Memory Interface with Arduino.

HW & SW :
Uno,24AA512 in Proteus simulator.(I don't have 24AA512 now. That is why)
Arduino 1.6.13

I am trying to interface SPI EEPROM Memory chip with my Arduino. I get and read the data sheet

Wiring :

uno---eeprom
SCK--SCK
MISO--SO
MOSI--SI
SS--CS bar

WP bar and HOLD bar is tied with VCC.

Here is my code

#include <SPI.h>
boolean once=false;

const int button=2;
const int led=3;
long int val;

void setup(){
  pinMode(button,INPUT_PULLUP);
  pinMode(led,OUTPUT);
  digitalWrite(led,LOW);
  SPI.begin();
  delay(10);
  SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
  delay(10);
  digitalWrite(SS,HIGH);
  delay(10);
}

void loop() {
  //Write Operation once
  if(once==false){
    digitalWrite(SS,LOW);
    SPI.transfer(0x06);   //WREN Enable Latch before write operation
    digitalWrite(SS,HIGH);
    delay(10);
    digitalWrite(SS,LOW);
    SPI.transfer(0x02);   //Write Operation instruction
    SPI.transfer16(0x0000); // 16-bit address location in eeprom (write)
    SPI.transfer16(0xAA);   // data. content to write
    digitalWrite(SS,HIGH);
    once=true;
  }
  //Read Operation
  if(digitalRead(button)==LOW){
    delay(10); // for prober debounce
    digitalWrite(SS,LOW);
    SPI.transfer(0x04);   //WRDI Latch Disable write latch
    digitalWrite(SS,HIGH);
    delay(10);
    digitalWrite(SS,LOW);
    SPI.transfer(0x03); //Read Operation Instruction
    val=SPI.transfer16(0x0000); // 16-bit address location in eeprom (read)
    digitalWrite(SS,HIGH);
  }
  // Check the data is stored correctly
  if(val==0xAA){
    digitalWrite(led,HIGH); // if data is same this led glow
  }
}

I cant get any response from my slave(I am using logic analyzer in Proteus).
Also Trying to enable the led if the data is written into that location.(My Led doesn't glow).

What is the mistakes I done ?. what I need to learn ?.

If you want I will share the wiring what I done in Proteus.

Thank you.

compare.. this

I read the link I had some doubts on that code.

spi_transfer((char)(address>>8)); what is this mean ?.

SPCR = (1<<SPE)|(1<<MSTR);
  clr=SPSR;
  clr=SPDR;
  delay(10);

SPCR =(1<<SPE)|(1<<MSTR); what it does. right shift I know. but what it does.

delay(10);
  digitalWrite(SLAVESELECT,LOW);
  spi_transfer(WRITE); //write instruction
  address=0;
  spi_transfer((char)(address>>8));   //send MSByte address first
  spi_transfer((char)(address));      //send LSByte address 
  //write 128 bytes
  for (int I=0;I<128;I++)
  {
    spi_transfer(buffer[I]); //write data byte
  }
  digitalWrite(SLAVESELECT,HIGH); //release chip
  //wait for eeprom to finish writing
  delay(3000);

SPI.transfer (or) spi_transfer ?.

address = 0; //now the address contain zero.
spi_transfer((char)(address>> 8 )); //what it does ?. explain what contain now in address variable.
spi_transfer((char)(address)); //what it does ? explain what contain now.

Any help ! I am stuck here.

SPCR = (1<<SPE)|(1<<MSTR);
  clr=SPSR;
  clr=SPDR;
  delay(10);

can I use like this SPCR=b01010000 instead of SPCR = (1<<SPE)|(1<<MSTR); ?.

I am stuck here. any one help.

What happens when you try it on real hardware ?

I don't have this chip. so I tried using Proteus. also I attached logic analyzer(inside Proteus) for debugging purposes in Proteus simulation.

Not done in hardware.

What did they say on the Proteus forum?

can I use like this SPCR=b01010000 instead of SPCR = (1<<SPE)|(1<<MSTR); ?.

Assuming they're equivalent (I don't have the register definitions to hand) yes, of course you can make your code less easy to understand. (It's "0b01010000" not "b01010000")

ok. thank you.