> ;------------------------------------------------------ > ; Write data (in EEPARAM) to EEPROM location (in W) > ;------------------------------------------------------ > SetEEData: > bsf STATUS,RP1 ; Bank 2 > bcf STATUS,RP0 ; Bank 2 Check out my DBANKIF and related macros in STD.INS.ASPIC at http://www.embedinc.com/pic/. What you are doing may be correct in this instance (I didn't check), but is a bug waiting to happen if you get the desired bank wrong. Let the assembler figure this out. > movwf EEADR > movf EEPARAM,W ; Data to be stored > movwf EEDATA You should be checking that the previous write completed by waiting for the WR bit in EECON1 to be 0. This could well be your problem. The relevant section in the manual is only 3/4 of a page. For the 16F87x see section 4.3 "Writing to the EEPROM Data Memory" on page 43 of DS3029C. > bsf STATUS,RP0 ; Bank 3 > bcf EECON1,EEPGD ; Point to data memory > bsf EECON1,WREN ; Enable writes > bcf INTCON,GIE ; Disable interrupts (if enabled) > movlw H'55' ; Special seq > movwf EECON2 ; ... > movlw H'AA' ; ... > movwf EECON2 ; ... > bsf EECON1,WR ; Start write operation > bsf INTCON,GIE ; Enable interrupts (only if being used) > bcf EECON1,WREN ; Disable writes > > bcf STATUS,RP1 ; Reset to bank 0 > bcf STATUS,RP0 ; > > WaitEEWriteComplete: > btfss PIR2,EEIF > goto WaitEEWriteComplete > > return ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.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