User`s guide
Code & Data Management
4-18 AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
4.1.2 Code swap
4.1.2.1 Principle The code load swap consists in the downloading of temporary codes in a part of the
microcontroller code section to be executed immediately. When this temporary code has
been completely run, the microcontroller automatically runs back on the permanent
code or a previous temporary code. This makes it possible to have a code memory
space share for temporary codes, expanding then the total code beyond the 64KBytes.
Indeed, the downloading of code with deciphering produces a non-insignificant over-
head time (above 0.1s). The critical code section, that is the system part, must react as
quick as possible with the hardware layer. Also, the code load swap must be rarely exe-
cuted to not load the CPU with overhead routines to the detriment of the system
reactivity.
Figure 4-4. Code load swap representation
4.1.2.2 Mechanism The code load swap mechanism is based on the code banking frame available under
the environment Keil µ Vision. Indeed, the asse mbly file “lib_system\bank-
ing\l51_bank.a51” has been deeply customized by Atmel to link code-load-swap
routines to the code banking frame. Also, the debugger has been reworked to support
the code load swap and the downloading of code banks will be transparent for you in
debugging mode in a future software delivery.
Thus, the code-load-swap mode is fully supported under the environment Keil µVision
enabling you to develop software beyond the 64K of the code memory space without
difficulty.
64KB RAM
data
reserved
xdata
bank code
common code
Loading once at startup
system code area
bank N
bank N-1
...
bank 1
common code
of Nand Flash
bank 2
Loading for each
bank change