This s/w writes reliably (AFAICT) to the 628's EEPROM. Unfortunately, like Jennifer Lopez, I'm more than a little behind and haven't time for post mortems on the other write code variants, but I still have one or two things I'd like to get clear in my own mind at some point The deal with the EEPROM locations erasing was that MPLAB writes FF to the whole block when you upload new code to the PIC. Unticking the EEPROM Data box before programming stopped that and so left previous contents as they were. I should've spotted that, but I'll take the Homer stance - "It's everybody's fault but mine" ;-) Thanks for the input chaps ========================================== ;ee_628.asm ; ;7th February 2002 ; list p=16F628 #include led equ 0x04 ;indicator - lights for short time during write go equ 0x05 ;push button, start write start equ 0x00 ;program start vector ram equ 0x20 ;start of RAM in bank0 __config _intrc_osc_noclkout & _wdt_off & _pwrte_on & _lvp_off & _boden_off org 0x00 goto entry entry clrf porta movlw 0x07 ;comparators off movwf cmcon clrf status ;set rp0, rp1 = 0 = Bank0 bsf status,rp0 bcf status,rp1 movlw b'00000000' ;oooo oooo movwf trisa movlw b'00100000' ;ooio oooo movwf trisb movlw 0x80 movwf option_reg bcf status,rp0 bcf status,rp1 clrf porta clrf portb wait btfsc portb,go ;look for PB press/release on b.5 goto wait waitl btfss portb,go goto waitl STEE bsf PORTB,LED bsf STATUS,RP0 ; bcf STATUS,RP1 ;bank 1 movlw 0x10 movwf EEADR movlw 0xd2 movwf EEDATA ;load address and data WRITE bcf INTCON,GIE bsf EECON1,0x2 ; eecon1,wren movlw 0x55 movwf EECON2 ; eecon2 movlw 0xAA movwf EECON2 ; eecon2 bsf EECON1,0x1 ; eecon1,wr WREND btfsc EECON1,0x1 ;wait for WR bit clear goto WREND bcf EECON1,0x2 ; eecon1,wren bcf STATUS,RP0 ; bank 0 bcf PORTB,LED ENDWR goto ENDWR end -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads