> >>What I found curious in their demo was that > >>they didnt wait for any flags to signal write completion(!).. > That's because they didn't care on exit... They check it BEFORE they > enter the routine. > > That's probably just fine, *IF* they test the flag > > *before* writing. Didn't they do that either ? > Yes, they did. Do they? I don't see any checking in this code here: main call ewrite nop incf EEDATA incf EEADR,F movf EEADR,W xorlw 0x30 ; compare for stop write btfsc STATUS,Z goto finis movlw 0x00 goto main finis bcf STATUS,RP0 bsf PORTB,0 ; LED attached to PORTB,0 will light goto finis ; Endless loop - done ewrite ; WRITE ROUTINE bsf STATUS,RP0 ; BANK 1 bsf EECON1, WREN ; Enable write movlw 0x55 ; movwf EECON2 ; Write 55 ( required ) movlw 0xAA movwf EECON2 ; Write AA ( required ) bsf EECON1,WR ; Set WR bit retlw 0 I don't see it.. Do you? -- andrew -- 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