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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/25/05 10:20
Read: times


 
#93870 - movx a,@dptr
Responding to: ???'s previous message
Thank you for the quick responses.
sorry for the unformatted code, i don't know if it is possible to upload the properly formated asm file.

I did move dyta to another location (I used 27h),this is not the problem. The problem is somewhere here:

Prog_eep:
mov dptr,#File_str ;Print "send file now" string
lcall outstr ;

; get Chars, convert to hex, store in NVRam
lcall load1
;so now all of the file that was read by the serial port is in
;ram @ addr 4000h, very last address saved in
;filesizeH, FilesizeL

mov dptr,#Prog_str
lcall outstr ;print string "programming eeprom"

mov dptr,#4000h
mov addrhi,#0
mov addrlo,#0

Prog_Loop:
movx a,@dptr ;get data byte
mov dyta,a

;i checked by using a printbyte routine
;here and the data being printed is correct byte for byte

inc dptr

;we have addrhi, addrlo, & data set up,write it

LCALL EEPROM_WRITE2 ;write one byte

;here we check dptr against last addr previously loaded to NVRAM
;last addr = filesizeH, filesizeL

mov a, dpl ; check low byte
mov b,filesizeL ;
cjne a,b,Prog_Loop1 ; a<>b? keep programming
mov a, dph ; a = b? check high byte
mov b,filesizeH ;
cjne a,b,Prog_Loop1 ; a<>b? keep programming
sjmp Prog_End ; end program


Prog_Loop1:
inc addrlo ;inc write address
mov a,addrlo ;check low byte address
jnz Prog_Loop ;only inc high byte if low byte
inc addrhi ;= 0
sjmp Prog_Loop ;continue programming eeprom


Prog_End:
mov dptr,#Success_str ;show success string
lcall outstr
lcall Inchar ;wait for keypress to continue
ljmp Main

again, i checked everything I could possibly think of! I am stumped! I am 100 sure that the eeprom write is working perfectly since I tried another data fill eeprom write which works perfectly every time, with the same eeprom write routines.

How long should the delay be after writing one byte to the eeprom?

List of 9 messages in thread
TopicAuthorDate
movx a,@dptr!            01/01/70 00:00      
   I think your problem is...            01/01/70 00:00      
   No Michael            01/01/70 00:00      
   DYTA EQU 10H?            01/01/70 00:00      
   movx a,@dptr            01/01/70 00:00      
      code format            01/01/70 00:00      
      WHICH EEPROM            01/01/70 00:00      
      the error...            01/01/70 00:00      
         movx a,@dptr            01/01/70 00:00      

Back to Subject List