Hello, I seem to be having problems writing to the EEPROM data, or maybe it could be reading it back, but anyway I was wondering if someone could look at the following code and tell me what I have done wrong. I have to routines, ReadEEprom and WriteEEprom, each of which use the FSR0 register to point to the source or destination data and use A_ARG_H for the number of bytes to read or write and A_ARG_L to contain the start address of the EEADR in which the data is located. CODE ReadEEProm: GLOBAL ReadEEProm MOVWF A_ARG_H,BANKED MOVF A_ARG_L,W,BANKED MOVWF EEADR,A BCF EECON1,EEPGD,A RDLoop: BSF EECON1,RD,A MOVF EEDATA,W,A ;Read the byte. MOVWF POSTINC0,A DCFSNZ A_ARG_H,F,BANKED RETURN INCF EEADR,F,A BRA RDLoop WriteEEProm: GLOBAL WriteEEProm ;Working register contains number of bytes to write. MOVWF A_ARG_H,BANKED ;Save count MOVF A_ARG_L,W,BANKED ;Get EEADR MOVWF EEADR,A BCF EECON1,EEPGD,A BSF EECON1,WREN,A WRLoop: MOVF POSTINC0,W,A ;Get the data to write. MOVWF EEDATA,A BCF INTCON,GIE,A MOVLW 0X55 MOVWF EECON2,A MOVLW 0XAA MOVWF EECON2,A BSF EECON1,WR,A BSF INTCON,GIE,A WRWait: BTFSS PIR2,EEIF,A BRA WRWait BCF PIR2,EEIF,A ;Clear it for next write. DCFSNZ A_ARG_H,F,BANKED BRA WRFinished INCF EEADR,F,A BRA WRLoop WRFinished: BCF EECON1,WREN,A RETURN END Thanks, James -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.