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. ;start bsf STATUS, RP0 movlw 0x0FF movwf EEDATA clrf EEADR nxtadr bsf EECON1, WREN movlw 0x055 movwf EECON2 movlw 0x0AA movwf EECON2 bsf EECON1, WR bcf EECON1, WREN clrwdt incf EEADR, F movlw 0x07F xorwf EEADR, W btfss STATUS, Z goto nxtadr bcf STATUS, RP0 ;end Thanks, --Nick __________________________________________________ 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