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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/13/06 12:49
Read: times


 
#126405 - where to place the code
Responding to: ???'s previous message
Arvind,

Only the FLASH_API (FLASH_PROGRAM or call-it-what-you-want) must be above 2000h. More precisely, the part, when you flip the bits in FCF to map the BOOT FLASH (Block 1) into the 0000h-1FFFh area.

In other words, the rest of your code, including call FLASH_whatever may be wherever you want; plus the user code starts ecexuting from 0000h, so that's where your jmp Start must be located.

Arvind said:
I dont understand fully FIRMWARE_FLAG: db 0 ...

That's an initial value, indicating the "untouched-yet" or "fresh" device. The flash location addressed by FIRMWARWE_FLAG will contain 0 after you burn the firmware into it. After the password is entered the first time, you should erase it (=0FFh), which then upon subsequent resets indicates "device already in use, password has been already assigned".
You might do it in any other way you want, of course; e.g. initialize to 0FFh and set to 0 when password is entered, or having a default password; it's up to you.

Arvind said:
also ... ORG 3200h is the starting address of my START subroutine and not the address of my password ...

OK, why not. Then tell us, where do you want to place the password?

Arvind said:
you can see that I have moved the value of r4 and r5 in dptr ...

Yes, clearly indicating, that you want to program data into 3200h location. If you code is supposed to sit there, you should not attempt to overwrite it...!

Arvind said:
I am sorry 3200 is decimal

Then you shouldn't append consistently the h suffix to it, indicating clearly it is a hexadecimal value...


Arvind said:
and I have converted to hex and then moved to dptr ... and jumping to 3200h ... could please tell me the stupidity I am doing here ... as I am confused ...

The trouble is, that you wrote the comments in a wrong way.

OK, rethink the whole thing once again, rewrite it (best from scratch) and come back.

Jan Waclawek


PS. Please stop using SMS abbreviations such as "daz y" instead of "that's why". SMS-talk is considered rude on this forum. Thanks.


List of 50 messages in thread
TopicAuthorDate
how to write in EEPROM in P89V51RD2 ?            01/01/70 00:00      
   there is no such thing as an EEPROM            01/01/70 00:00      
   eh?            01/01/70 00:00      
      I mean FLASH ...            01/01/70 00:00      
         FlashMagic            01/01/70 00:00      
            I have flash magic            01/01/70 00:00      
               that IS what FlashMagic does            01/01/70 00:00      
                  All of them ...            01/01/70 00:00      
                     I'm at a loss            01/01/70 00:00      
                  Probs is password storing ...            01/01/70 00:00      
                     you have not, see above            01/01/70 00:00      
                        just give me an idea            01/01/70 00:00      
                           datasheet            01/01/70 00:00      
                     clear question will help            01/01/70 00:00      
         read the ... datasheet            01/01/70 00:00      
            P89V51 IAP (access)            01/01/70 00:00      
         Unfortunate terminology!            01/01/70 00:00      
   I read data sheet            01/01/70 00:00      
      read about IAP!!!            01/01/70 00:00      
         IAP code example...            01/01/70 00:00      
            this is NOT for P89V51RD2!            01/01/70 00:00      
               Use 89S52 / 89S8252            01/01/70 00:00      
                  I\'d guess...            01/01/70 00:00      
            few questions ...            01/01/70 00:00      
               Do you read my posts?            01/01/70 00:00      
   I have tried but failed ...            01/01/70 00:00      
      corrupted???            01/01/70 00:00      
         Dont know            01/01/70 00:00      
            How do you know that they are corrupted?            01/01/70 00:00      
            Refer the application notes for the P89V51RD2            01/01/70 00:00      
               Detail Problem ...            01/01/70 00:00      
                  think!            01/01/70 00:00      
                     program ...            01/01/70 00:00      
                        ehm....            01/01/70 00:00      
                           Well confused!            01/01/70 00:00      
                              one has to start somewhere...            01/01/70 00:00      
                                 Flowcharts            01/01/70 00:00      
                                    I don't think it's a good idea...            01/01/70 00:00      
                        Jan ... Guide me more            01/01/70 00:00      
                           where to place the code            01/01/70 00:00      
                  BIBLE TIME            01/01/70 00:00      
                     BASICs            01/01/70 00:00      
                        A very basic question            01/01/70 00:00      
                           to Arvind            01/01/70 00:00      
                           if you mean BASIC52/RD2 v1.4beta4...            01/01/70 00:00      
      the dangers of uncharted waters withou a pilots            01/01/70 00:00      
         maybe            01/01/70 00:00      
            I would not dare that            01/01/70 00:00      
               sunset...            01/01/70 00:00      
                  Mr. Shrivastava you are Wasting other's time            01/01/70 00:00      

Back to Subject List