Peter, I wrote these functions for a PIC16F877 and Hi-Tech C which may be helpful to you. Pretty simple and uncomplicated - one function for reading a byte and one for writing a byte. They were written following the procedure on the data sheet, have been tested in the field and seem to work OK. unsigned char eeread(unsigned char address){ EEADR = address; // Specify address to read EEPGD = 0; // select EEPROM data memory RD = 1; // perform read return EEDATA; // return the read data } void eewrite(unsigned char address, unsigned char data){ EEADR = address; // Specify address EEDATA = data; // and data to write EEPGD = 0; // select EEPROM data memory WREN=1; // Enable writing GIE = 0; // Disable interrupts EECON2 = 0x55; // special code EECON2 = 0xAA; // special code WR = 1; // Begin write GIE = 1; // Enable interrupts while(!EEIF); // Wait for write complete EEIF=0; // Clear write complete flag WREN=0; // Disable writing } Peter Keller wrote: > I would like to program the 256 bytes EEPROM using the CCS Compiler. > Does anybody know how to code this ? > Peter Keller Brent Brown Electronic Design Solutions 16 English Street Hamilton, New Zealand Ph/fax: +64 7 849 0069 Mobile: 025 334 069 eMail: brent.brown@clear.net.nz