5 startup, 6 bank-switching code, Startup – Maxim Integrated 71M6534 Energy Meter IC Family Software User Manual
Page 37: Bank-switching code, 7 page table setup and debug

71M653X Software User’s Guide
Figure 4-2, Selecting a Bank for a File Group in Keil C
4.9.5 Startup
TSC provides special start-up code on the CD-ROMs shipped with the 71M653X Demo Kits. The code can be found at
Util\startup_30_banked.a51. This file sets up the bank-switching logic. It must be included in the build. Any other
startup.a51 file must be removed.
4.9.6 Bank-Switching Code
TSC has already ported Keil’s bank-switching code, Util\L51_bank.a51. TSC’s version of this file should be included in
the build. TSC has already selected the fastest standard bank-switching method as the default.
During performance testing, TSC made a good-faith attempt to port the other bank-switching methods in this code,
including features needed by Keil’s advanced Lx51 linker. However these versions are not extensively tested.
4.9.7 Page Table Setup and Debug
Keil’s linkers produce the page table automatically, once paging is selected in the Microvision options->target dialogue.
Keil usually places the page table at an address of 0x100 in the common bank. It is visible in the linker .m51 file. To
see how it works, one can use the emulator to single-step through at a banked function call at the assembly language
level.
To call a paged subroutine, Keil’s linker arranges to call one of the entries of the page table. The page table consists
of one entry per subroutine. Each entry is a small piece of code that loads the address of the banked subroutine into
the 8051 register DPTR, and then jumps to paging code. The paging code sets the bank register FL_BANK, and then
jumps to the banked code’s address contained in the DPTR.
v1.1v1.1
TERIDIAN Proprietary
37 of 116
© Copyright 2005-2008 TERIDIAN Semiconductor Corporation