| ??? 02/25/03 02:04 Read: times |
#39985 - RE: maximum amount of memory Responding to: ???'s previous message |
I banked the FLASH memory on a Cygnal C8051F126 processor. This part has 128K bytes of FLASH and in order to be able to use it you must organize your code into banks. This part has all the bankswitching logic built on board so at least the hardware in a project looks fairly clean. (External bankswitching has been in use for years on 8x51/x52 type systems. It works by having the upper addresses of the memory driven off the bits in a port or a register.
On the above mentioned Cygnal part the bank switching port is setup so that the first 32K of FLASH is always visible at code addresses 0000->7FFF. In the code addresses 8000->FFFF there are two bits in an onboard bank register that control which 32K block of the FLASH can be seen. The Keil C compiler and BL51 (banking linker) work together with special code you include with the C startup code to automatically build a jump table scheme in the the low (aka the COMMON) bank to switch the upper bank to the page for a function being called and then call into that bank. The whole scheme supports calls to subroutines from COMMON to BANKx, BANKx to COMMON, COMMON to COMMON, BANKx to BANKx, and BANKx to BANKy. The scheme works fairly well but I would note the following...... - Do not use it in assembler, just with C - Bank switching can be fairly efficient if the called subroutines are hefty. A normal non-banked LCALL instruction turns into a lengthy process involving about 30 opcodes when you LCALL across an bank boundary. For this reason if you were calling subroutines with 30 opcodes across banks you would be spending 50% of the CPU time in the bank switching logic. On the other hand if the called routines are hundreds of opcodes then the 30 spent bank switching will be quite small. - Bank switching calls should be reserved for non time critical program code. Examples of this may be slow user interface code, meny painting and key parsing trees. - Try to avoid bank switching when your code contains function pointers and those pointers are used to call banked functions indirectly. It is still possible to combine bankswitching with the real time high performance code. You have to keep your interrupt handlers and all time critical code in the common bank and have it interact between its subroutines there. Michael Karas |
| Topic | Author | Date |
| maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: 23 not 15 | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
RE: maximum amount of memory | 01/01/70 00:00 | |
| The elusive universal board | 01/01/70 00:00 | |
| RE: The elusive universal board | 01/01/70 00:00 | |
| RE: The elusive universal board | 01/01/70 00:00 | |
| RE: Typical, or Legacy? | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 | |
| RE: maximum amount of memory | 01/01/70 00:00 |



