MILAN BASA wrote: > > I need a little example of code how to work with internal data memory > (16f84).Is there anybody who can help me with this free part of > program? > Thanks, Milan. Here's some code. To use it... ----------------- ; Save movlw 'A' movwf EEDATA ; data to save = 'A' clrf EEADR ; at EEPROM address 0 call EEwrite ---------------- ; Read clrf EEADR call EEread ; 'A' data is back in W ---------------- ; ; EEPROM READ ; Data returned is in W ; EEread movwf EEADR bsf STATUS,RP0 ; ram page 1 bsf EECON1,RD bcf STATUS,RP0 ; ram page 0 movf EEDATA,w ; read eeprom value return ; ; EEPROM WRITE ; Assumes EEADR and EEDATA are preset ; EEwrite bsf STATUS,RP0 ; ram page 1 bsf EECON1,WREN ; set WREN bit = 1 nop movlw 55h ; eeprom write movwf EECON2 movlw 0xAA movwf EECON2 bsf EECON1,WR ; set WR bit to initiate write ; wtloop btfss EECON1,EEIF ; wait until write is finished goto wtloop ; bcf EECON1,WREN ; clear WREN bit bcf STATUS,RP0 ; ram page 0 return --------------- -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu