[Edit] As to why they claim you only have 255 bytes? I don't know. There appears to be nothing in there at all. And I can write to bytes >0xFF so not really sure
[/edit]
This should suit you needs:
Code:
unsigned char readEE(unsigned char addrH,unsigned char addrL) {
EEADRH = addrH;
EEADR =addrL;
EECON1bits.EEPGD =0;
EECON1bits.CFGS =0;
EECON1bits.RD =1;
return EEDATA;
}
void writeEE(unsigned char addrH,unsigned char addrL,unsigned char data)
{
EEADRH = addrH;
EEADR =addrL;
EEDATA = data;
//following as per spec. sheet
EECON1bits.EEPGD =0;
EECON1bits.CFGS =0;
EECON1bits.WREN =1;
INTCONbits.GIE = 0;
EECON2 = 0x55;
EECON2 = 0xAA;
EECON1bits.WR = 1;
INTCONbits.GIE = 1;
EECON1bits.WREN = 0;
}