
#define AT24C256 0x50	// 0101 0000

void main(void)
{
  i2c_init(0x00, 0);
  EA=1;
  IndexTx=3;   // bytes to write to memory
  i2cVector[0]=0x00;
  i2cVector[1]=0x00;
  i2cVector[2]=0x5A;
  while(1)
  {
     if (i2c_getstatus() == I2C_OK)
       i2c_transmit(AT24C256);
     IndexRx=1;  // bytes to read from memory
     if (i2c_getstatus() == I2C_OK)
       i2c_receive(AT24C256);
  }
  while(1);
}