programming of 89c52

Discussion in 'Embedded Systems and Microcontrollers' started by KRISHNENDHU, Sep 12, 2012.


    Thread Starter New Member

    Sep 11, 2012
    I burned a program in a new location without overwriting the old one.But now the problem is,only the new program is running.So what should I do if I want to run or retrieve my old program?
  2. absf

    AAC Fanatic!

    Dec 29, 2010
    I have not use 80x51 for a long time. I hope my memory still serves me right..

    OK, I suppose you wrote your second program with a new "ORG" with an address pointing after the end of the first program. But for your second program to run, you'd have to set the reset vector ie ORG at address 0000 to point to the start of your second program.

    When the second program was burned into the program memories, and now you are running your second program. How are you going to change the ORG 0000 to point to your first program without burning new program codes into your mcu?

    Or have you set a trap door in the second program to jump to the first program when a certain condition is fulfilled?

  3. Arm_n_Legs

    AAC Fanatic!

    Mar 7, 2007
    I am not sure how is it possible to leave your old program in the code memory of the 8051. 8051 starts running code that are located in code location 0000H. Your old program would have code located there. In order for your new program to run, it has to be located at 0000H. Therefore, it would over-written your old program. However, the code at 0000H could be a simple LJMP to your main program. Your old program, say, could have a LJMP 100H, where the main program starts at 100H, and the new one has a LJMP 500H. You will need to reprogram the code located at 0000H to point to the old program, provided the old codes are still in the memory.