This is the routine :
;---------------------------------------------
; the value to write is in variable sup
; the address si in register w
;--------------------------------------------
Scrivi_Dato
BSF STATUS, RP1
BCF STATUS, RP0 ; Bank 2
movwf EEADR ; EEADR<=w
Banksel sup
Movf sup,0 ;w<=sup
BSF STATUS, RP1
BCF STATUS, RP0 ; Bank 2
movwf EEDATA ;EEDATA<=w
BSF STATUS,RP0 ; Banco 3
BCF EECON1,EEPGD ;Punta alla Data Memory
BSF EECON1,WREN ;Abilito la scrittura
BCF INTCON,GIE ;Disabilita interrupt
movlw 55h
movwf EECON2
movlw 0AAh
movwf EECON2
BSF EECON1,WR ;Abilito scrittura
BSF INTCON,GIE ;Abilita interrupt
SLEEP
BCF EECON1,WREN ;Disabilito scrittura
Return
the program remains blocked on instruction SLEEP.
Excuse me for my bad English i hope that you can understand my problem and help me.
Thank you
Bye