Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/01/99 14:34
Read: times


 
#787 - copy Internal RAM to EEPROM
I use AT89S8252 and I use code:

WMCON DATA 96h ;watchdog,memory ctrl
;register
EEMEN EQU 08h ;00001000b eeprom
;access enable bit
EEMWE EQU 10h ;00010000b eeprom write
;enable bit
WDTRST EQU 02h ;00000010b eeprom bsy bit

ORG 0000H

MOV R1,#255
START: MOV @R0,#0FFh ;write FF in IRAM
INC R0
DJNZ R1,START
mov p1,#01010101b ;


MOV R0,#0
MOV r4,255
orl WMCON,#EEMEN ;ENABLE EEPROM
;access
ORL WMCON,#EEMWE ;ENABLE EEPROM
;write
MOV DPTR,#0300H

LOOP005: MOV A,@R0 ;read ram
mOVX @DPTR,A ;write eep
WAIT_WRITE001: MOV A,WMCON ;wait
ANL A,#WDTRST ;
JZ WAIT_WRITE001;
INC DPTR
INC R0
DJNZ r4,LOOP005

XRL WMCON,#EEMEN ;DISABLE EEPROM ACCESS
XRL WMCON,#EEMWE
jmp $ ;wait forever


With the above code i wrote ffh in IRAM
i read IRAM and i wrote data in EEPROM (on chip).
Next i use my programmer to read EEprom but unfortunately i did not read FFh but garbage ????????
Is this logical??????


List of 3 messages in thread
TopicAuthorDate
copy Internal RAM to EEPROM            01/01/70 00:00      
RE: copy Internal RAM to EEPROM            01/01/70 00:00      
RE: copy Internal RAM to EEPROM            01/01/70 00:00      

Back to Subject List