Hi: I have read one of the app note that keil provided "in-system flash programming" (http://www.keil.com/support/docs/2364.htm) and became confused. In my opinion, the uC core can only fetch instruction from rom or flash. But as the app note said, the code can be execuated in ram(using srom class). The way of copy the code from flash to ram can be easily understand, but how can it execuate there. In my opinion, the process of how to fetch instruction is only decided by the core construction, but not the complier or linker tools. what is the real instruction fetch mechanism about 51MCU. Is there any document related ? I do not know search what key point for this question. Thaks for your help.
aaa1982
The way of copy the code from flash to ram can be easily understand, but how can it execuate there.
If RAM is mapped into code space, code can be executed from there. There's no difference for the MCU.
However, there needs to be a mechanism for copying the code to the RAM, since the 8051 does not have any instructions that write to code space. This can be accomplished, for example, by mapping the same RAM into the XRAM space, or by using SFRs to access this RAM.
hi Christoph: Thanks for your replying. If RAM is mapped into code space, code can be executed from there. There's no difference for the MCU. I want to know how to map the RAM into the CODE space and if all of the MCU(such as C8051F series)support memory mapped? In other words, if I want to map the ram into code space, what MCU should I used?
Jason liu
I want to know how to map the RAM into the CODE space simple use a negative OR (same as a positive AND) of !PSEN and !RD to read the RAM. and if all of the MCU(such as C8051F series)support memory mapped? Memory mapped I/O (the usual meaning of 'memory mapped'), yes, but I do not think that is what you mean In other words, if I want to map the ram into code space, what MCU should I used? Any derivative with the ability to use external code memory (no C8051F (assuming you refer to SILabs) can)
Erik
PS WHY do you want to do this?
View all questions in Keil forum