Brent, realy nice program, I will make use of it one day. But I need something different. oviously I was not clear in my eplanation. In the CCS manual p.24 is a description of the #ROM Pre-Processor command. Example: #rom 0x2100={1,2,3,4,} This does not hit the point. What I need is as follow: org 0x2100 const char table1[8] = {"Table1"}; ... ... const char table4[8] = {"Table1"}; Brent Brown schrieb: > 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