Searching \ for ' Internal data memory' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/mems.htm?key=data
Search entire site for: 'Internal data memory'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] Internal data memory'
2002\04\11@175924 by MILAN BASA

flavicon
face
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.
spam_OUTbasamTakeThisOuTspamemo.seas.sk

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2002\04\11@181829 by Tony Nixon

flavicon
picon face
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
salesspamKILLspambubblesoftonline.com

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...