That was it, I was looking at PIR1 in bank 1 and not 0. If anyone is interested, here is the working code: clrlog bcf PIR1, EEIF ;clear EEIF flag bsf STATUS, RP0 ;bank 1 movlw 0x0FF movwf EEDATA ;put 0x0FF into EEDATA, empty memory cell value clrf EEADR ;start at first address nxtadr bsf EECON1, WREN ;enable write movlw 0x055 movwf EECON2 movlw 0x0AA movwf EECON2 bsf EECON1, WR ;start writing bcf EECON1, WREN ;disable write clrwdt bcf STATUS, RP0 ;bank 0 btfsc PIR1, EEIF ;wait until write operation is complete before continuing goto $+3 ;continue once write is complete clrwdt goto $-3 bcf PIR1, EEIF ;clear EEIF flag bsf STATUS, RP0 ;bank 1 incf EEADR, F ;increment to next address movlw 0x07F xorwf EEADR, W btfss STATUS, Z ;leave loop when all addresses up to 0x07E are cleared goto nxtadr bcf STATUS, RP0 ;bank0 Thanks to everyone who helped me on this! --Nick --- Bob Barr wrote: > On Sun, 17 Feb 2002 09:09:15 -0800, Nick Masluk > wrote: > > Comments inline. > > >I've now tried clearing the WDT within the loop > that > >checks if the write is complete. It ends up > clearing > >the first memory block, and then just sits in the > >write complete check loop, and never moves on to > clear > >any other of the addresses. Here is what the code > now > >looks like: > > > >;start > > bsf STATUS, RP0 > > movlw 0x0FF > > movwf EEDATA > > clrf EEADR > > bcf PIR1, EEIF > ^^^^^^^^^^^^^^^^^^^^^^ > Danger, Will Robinson. PIR1 is in bank 0, you're in > bank 1. > > >nxtadr bsf EECON1, WREN > > movlw 0x055 > > movwf EECON2 > > movlw 0x0AA > > movwf EECON2 > > bsf EECON1, WR > > bcf EECON1, WREN > > clrwdt > > btfsc PIR1, EEIF > ^^^^^^^^^^^^^^^^^^^ > Same here. > > > goto $+3 > > clrwdt > > goto $-3 > > bcf PIR1, EEIF > ^^^^^^^^^^^^^^^^^^^ > And here. > > > incf EEADR, F > > movlw 0x07F > > xorwf EEADR, W > > btfss STATUS, Z > > goto nxtadr > > bcf STATUS, RP0 > >;end > > > > Regards, Bob > > -- > 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 > > __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- 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