Nope, that doesn't seem to be it. I added the following code to the end of all places where the EEPROM is written to, and it always ends up in a WDT time-out. btfss PIR1, EEIF goto $-1 bcf PIR1, EEIF I think this may not have been working because it is an interrupt flag, and I have all interrupts disabled, therefor the flag may be inactive. And if clearing the EEIF flag was such an important part in properly writing to the EEPROM I would like to think that more mention to it would have been made than in that small section of 13.2. --Nick --- Bob Barr wrote: > 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 > > 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 > > __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads