I'm having problems reading or writing the EEPROM data memory on a PIC18F458. I've faithfully copied the simplest piece of code from the PIC18FXX8 data sheet 5-1 but it doesn't return the correct value. The value in EECON1 stays at 0xC0 unless you clear EEFS which then allows EEPGD to be cleared. This is not shown in the example. Whatever address I select in EEADR (0x00-0xFF) it always returns 0xFF in EEDATA. I know what is stored at each of these addresses as I have set them using the following. ORG 0xF00000 ;from MPASM help FLASHVARIABLE DE 0x12 ;etc Flash memory set using this & viewed ok in MPLAB window. There seems to be some confusion in the data sheet PIC18FXX8.PDF as the diagram 5-1 refers to bit 6 as EEFS in EECON1 whereas diagram 6-1 refers to bit 6 as CFGS. The Errata file indicating problems with timing a RD immediately after a write to EEADR doesn't apply here as the example code doesn't do this. The device is being accessed using ICD2 and this works fine except for this issue. You can change the flash data in the MPLAB window so there's nothing wrong with the chip. My guess is that there is another line missing from the example but I can't put my finger on it. Any ideas? I have also used the sample code for writing to the Data EEPROM and this doesn't work either. If the EEPROM write interrupt is enabled, I can trap the interrupt & find the relevant EEPROM write flag bit is indeed set but the data just doesn't get written. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics