Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Self Bootloader

Status
Not open for further replies.

PlsHelp

New Member
Hi,

Currently i have success download the hex data to SRAM and running the program. Now I would like to save the CODE data on external eeprom whenever power is ON will automatically download the data to SRAM and start running the program without manualy set the /EA to GND.

I have found this method 8051 von Neumann Memory ( 8051 von Neumann Memory Example Program ). I'm not sure this method will solve the problem not.

void main (void)
{ load_vonNeumann_memory (); // Load VN memory

((void (code *) (void)) 0xE000) (); // Call function in VN memory

while (1) // Loop Forever { }
}

May i know this load_vonNeumann_memory (); function will be the bootloader portion? Download the hex data to SRAM. The next ((void (code *) (void)) 0xE000) (); function will be the external CODE execution start at 0xE000 address. Am i rite?

I have tested but no work. May be is the "Options for Target" Off-chip Code Memory and Off-chip Xdata memory setting is wrong.
Let say, my application code define is :-
Off-chip Code Memory: start = 0x0000, size = 0x4FFF
Off-chip Xdata memory: start = 0x5000, size = 0xAFFF
I'm using 2 32kB SRAM.

How can i do the setting on the 8051 von Neumann Memory?
If this method can't make it. Is there any other method to run the external code without doing the /EA to GND setting?

Thank you.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top