
/******************************************************************************
* NAME:        writePage                                                      *
* DESCRIPTION: This function writes a page to a specified address             *
******************************************************************************/
void writePage()
{
    unsigned char xx;
    i2c_Start();                // start condition
    i2c_SendAddress(ROM, 0);    // 0 = write, 1 = read, ROM is 0xA0 
    i2c_ReadAcknowledge();      // wait for acknowledge from EEPROM
    i2c_SendByte(0);            // send upper address byte
    i2c_ReadAcknowledge();      // wait for acknowledge from EEPROM
    i2c_SendByte(0);            // send lower address byte
    i2c_ReadAcknowledge();      // wait for acknowledge from EEPROM
    for(xx = 0; xx < 64; xx++)  // write test page to read by external programmer
    {
        i2c_SendByte(xx);       // write the data to EEPROM
        i2c_ReadAcknowledge();  // wait for acknowledge from eeprom
    }
    i2c_Stop();                 // stop initiating the self-timed write
    