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 16:53
Read: times


 
#110695 - Oh I see...
Responding to: ???'s previous message
Those are SFR's and user defined variables. I'm curious to know what document you are reading other than the datasheet, which doesn't even explain those particular SFR's
From this application note
http://www.semiconductors.philips.com/acrobat/a...0342_1.pdf

I read:

• Move the LOAD command in the FMCON SFR.
• Move the low address of the byte to be programmed in the FMADRL SFR.
• Move the high address of the byte to be programmed in the FMADRH SFR.
• Move the data to be programmed in the FMDATA SFR.
• Move the ERASEPROGRAM command into the FMCON SFR.
After this sequence the internal Flash state machine will first do an erase operation on the
Flash byte and then program the data in the same Flash byte. The erase program
command takes 4ms, 2ms to erase and 2ms to program the byte.


Which means to me that this sequence must be performed for each byte. Now let's look at some of your code.

LOAD_PAGE:
	MOV	FMDATA,@R0 
        INC	R0 
        DJNZ	R3,LOAD_PAGE


Assuming R0 was already defined as 00H, R3 as 64. This takes the byte from location zero and puts it in FMDATA. Then you move the pointer to the next location and loops 64 times, but does nothing other than cycle through and when done FMDATA contains the 64th byte of data.

Then you:
        MOV	FMCON,#68H	; "ERASE" COMMAND FOR 89LPC952

Which initializes the erase/write sequence for the last byte only.

Seems to me that your loop is set up wrong.

Jon


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