#include <p18f4620.h>
#include <i2c.h>
#pragma config WDT = OFF
#pragma config MCLRE = ON
#pragma config LVP = OFF
#pragma config XINST=OFF
#pragma config OSC=INTIO67
#define CLOCK_FREQ (80000000ul) // Hz
void main(void)
{
char data;
OpenI2C(MASTER, SLEW_OFF);
StartI2C();
WriteI2C(0b10100000); //control byte
WriteI2C(0b00000000); //adr hi
WriteI2C(0b00000000); //adr lo
WriteI2C(0x25); //data 0
StopI2C();
StartI2C();
WriteI2C(0b10100001); //control byte (read data)
WriteI2C(0b00000000); //adr hi
WriteI2C(0b00000000); //adr lo
data=ReadI2C();
StopI2C();
}