This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Variable Banking

What is VARIABLE BANKING ?
For what situtations I shouldn't use Bank0 ?

Parents Reply Children
  • "Banking" in this context means accessing more physical memory than the usual 8051 address space (64KB code + 64KB data). This is done by dividing physical memory into "banks" (usually 32KB) and adding extra address decoding hardware to provide the extra address lines to the physical memory.

    The Keil tools support common ways of doing this for both the code address space ("code banking") and xdata address space ("variable banking").

    Data banking is perhaps most commonly done as a series of 64KB segments. There should be no particular issue about using bank 0 in this case.

    Code banking is commonly done as a 32KB "common" bank, with a series of 32KB switchable banks in the upper half of the address space. Given that memory always comes in powers-of-two sizes, one of the switchable banks will usually decode to the same physical memory locations as the common bank. Usually this will be bank 0. Since this physical memory is the common bank, you generally don't want to use bank 0 for any other purpose.