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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/24/06 19:03
Read: times


 
#110716 - updated code for 89LPC952 IAP
Responding to: ???'s previous message
Jon Ledbetter said:

I see the program to which you are referring, and I also see you are missing a line in the code you posted and what they have in the manual. Actually it's not missing, but appended to the end of a remark. This may not be the only problem.

Copy and paste is the best method.



Hi Jon,

Please can you explain what part of the code am I missing.....

The code which I have written is as follows:
          LOAD EQU 00H
          EP EQU 68H

INITALIZE:MOV R3,#64        
          MOV R4,#04H
          MOV R5,#40H
          MOV R7,#00H
PGM_USER: MOV FMCON,#LOAD ;load command,
          MOV FMADRH,R4 ;get high address
          MOV FMADRL,R5 ;get low address
          MOV A,R7 ;
          MOV R0,A ;get pointer
LOAD_PAGE:
          MOV FMDAT,@R0 ;write data to
          INC R0 ;point to next
          DJNZ R3,LOAD_PAGE ;do until count
          MOV FMCON,#EP ;else erase &
          MOV R7,FMCON ;copy status
          MOV A,R7 ;read status
          ANL A,#0FH ;save only four
          JNZ BAD ;
          CLR C ;clear error
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ADDITIONAL CODE TO LOAD 32H TO LOCATIONS 440H TO 480H
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
          MOV R3,#64 
          MOV FMCON,#LOAD ;load command
          MOV FMADRH,R4 ;get high address
          MOV FMADRL,R5 ;get low address 
LOAD_PAGE1:
          MOV FMDAT,#32H ;write data to FMDATA
          DJNZ R3,LOAD_PAGE ;do until count
          RET ;and return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BAD:      SETB C ;set error flag
          RET ;and return


The additional part of the code should auto-increment the FMADRL
and load "32h" to locations 440h-480h.
This does not take place.Can anyone explain why?

Aso please read the manual of 89LPC952 which states:

page 104:

" * Write the data to be programmed to FMDATA. This will increment FMADRL pointing to the next byte in the page register.

page 105:

* Write the address of the next byte to be programmed to FMADRL, if desired. (Not needed for contiguous bytes since FMADRL is auto-incremented). All bytes to be
programmed must be within the same page."

please refer the link for manual:

http://www.standardics.philips.com/support/d...lpc952.pdf


Thanks,
Shruthi



List of 22 messages in thread
TopicAuthorDate
89LPC952 FLASH PROGRAMMING            01/01/70 00:00      
   Notes on posting code            01/01/70 00:00      
   rewrritten code 89LPC952 IAP code            01/01/70 00:00      
      what more do you need            01/01/70 00:00      
         Not sufficient!!!            01/01/70 00:00      
            how did you not "see" that?            01/01/70 00:00      
               I have written the code....            01/01/70 00:00      
                  Looks to me like            01/01/70 00:00      
                     I have written the code            01/01/70 00:00      
                        How can writing a constant be "the next"            01/01/70 00:00      
                        Oh I see...            01/01/70 00:00      
                           Disreguard previous post            01/01/70 00:00      
                              a hint            01/01/70 00:00      
                               updated code for 89LPC952 IAP            01/01/70 00:00      
                                 The above correction ('ONE' should be '1            01/01/70 00:00      
                                 Ok...            01/01/70 00:00      
                                    That's exactly my question            01/01/70 00:00      
                                       How about....            01/01/70 00:00      
                                          Thanks it worked!!            01/01/70 00:00      
                                             You're welcome            01/01/70 00:00      
      Neat            01/01/70 00:00      
         If we go there, then            01/01/70 00:00      

Back to Subject List