On Sat, 16 Feb 2002 16:54:13 -0800, Nick Masluk wrote: >Below is the code I am using on a PIC16F627 to clear >the EEPROM from address 0x000 to 0x07E (0x07F stores a >variable that is not to be deleted). Sometimes it >works, sometimes it doesn't. When the code doesn't >work, the loop is still running, it just doesn't exit >it, because no WDT reset ever occurs. The PIC is >running 4MHz INTRC oscillator I/O function, and all >interrupts are disabled. Check datasheet DS40300B, section 13.2=20 I think the problem is that you aren't checkimg bit EEIF in register PIR1 to ensure that the previous write is complete before you write again. Note that this bit must be cleared by your code before you use it again to check for completion of the next write. Regards, Bob -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads