void main (void)
{
load_vonNeumann_memory (); // Load VN memory
((void (code *) (void)) 0x0000) (); // Call function in VN memory
while (1) // Loop Forever
{
}
}
The external code memory may be placed in the address space of 00 to 32k, but the initial 8k space will not be available.
What should i set to make the internal flash memory beyond 8k address will automatically continue run external code?Your initial 8k including the bootloader program can be kept in the internal flash memory and the program will automatically continue with external code memory after 8k address.
Alternatively, you store only bootloader in the internal memory and use the 24k upper address of the external memory for program and you make a jump to 8k+ external address to go to your external program from bootloader program.
((void (code *) (void)) 0x2000) (); // Call function in VN memory
What do you mean here? I have set this in my the STARTUP.A51you have to make an ljmp to the service routine address where it is stored.
CSEG AT 0x3000
?C_STARTUP: LJMP STARTUP1
C:0x8000 00 NOP
void runprog(void)
{
#pragma asm
ljmp 8000H
#pragma endasm
}
As you explanation will work and by rite should work but why i still can't solve the problem?when EA- is pulled high, for the first 8k address, no PSEN is generated and the code from the internal memory will be executed. In this case before the execution reaches 8K address, at any point you can jump to external memory address at or after 8k.
I have write a simple prints "Hello" message in external code. Just test a simple serial interface on Hyperterminal and try to set the Code range, Xdata range, Start-up address and interrupt vector address.I do not quite understand how you are testing your code and concluding it does not work.
What code have you loaded at 0x2000?
void main(void){
// SerialInit;
while(1){
// prints("Hello");
}
}
in this case your Main code should be assembled at 0x0000 in the internal flash memory of C52
void main(void){
// Bootloader;
// RunExternalProg; LJMP 0x2000
while(1);
}
After the RunExternalPrgo function will do nothing already.where the system control goes following the Reset.
I'm using Proteus simulation to draw the circuit. Without the MAX232 still will working fine. I have wire up and solder it the circuit on testing board. The testing board have MAX232 circuit.Also a small deviation from what is being discussed, you have not used a MAX232 chip to inetrface your serial interface of your circuit to PC as seen from your schematic, which is essentail.
may be after loading the code, you can read the code at 2000 and send it to PC as ASCII and check if the bytes are there as expected at 0x2000. This will verify if your loading part is working OK.
Yes, i have do this function as well. Using hand coded change the address. It is more flexible and easy to do testing.You can even try using your first simple program of writing directly the hand coded code of ljmp 0xE000 changed to 0x2000 in this case.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?