MCB517AC Evaluation Board User’s Guide
45
Code Banking Example
The following example program shows you how to use code banking with the
MCB517AC. Here are 7 source modules and one BL51 configuration module
which will be located in the common area and from bank 0 to 5. When you step
through this program with dScope for Windows you will see how bank switching
works.
/*-----------------------------------------------------------------------
ROOT.C
Copyright 1997 KEIL Software, Inc.
------------------------------------------------------------------------*/
#include <reg517.h>
extern void func0(void);
extern void func1(void);
extern void func2(void);
extern void func3(void);
extern void func4(void);
extern void func5(void);
void main(void) {
P4 = 0; /* switch off all LED’s */
while(1) {
func0(); /* call a function in bank 0 */
func1(); /* call a function in bank 1 */
func2(); /* call a function in bank 2 */
func3(); /* call a function in bank 3 */
func4(); /* call a function in bank 4 */
func5(); /* call a function in bank 5 */
P4 ^= 0x80; /* toggle LED 7 */
}
}
Select the following settings in the L51_BANK.A51 file:
?B_NBANKS EQU 8 ; Define max. Number of Banks
?B_MODE EQU 0 ; 0 for Bank-Switching via 8051 Port
?B_RTX EQU 0 ; 0 for applications without RTX-51 FULL
; ; 1 for applications using RTX-51 FULL
;-----------------------------------------------------------------------
; For Bank-Switching via 8051 Port define Port Address / Bits
P6 DATA 0FAH
?B_PORT EQU P6 ; default is P1
?B_FIRSTBIT EQU 5 ; default is Bit 3
;------------------------------------------------------------------------
Summary of Contents for MCB517AC
Page 6: ...vi Contents...
Page 23: ...MCB517AC Evaluation Board User s Guide 17 Schematics...
Page 24: ...18 Chapter 3 Hardware...
Page 25: ...MCB517AC Evaluation Board User s Guide 19...
Page 26: ...20 Chapter 3 Hardware...
Page 27: ...MCB517AC Evaluation Board User s Guide 21 Printed Board Assembly...
Page 32: ...26 Chapter 3 Hardware...
Page 34: ......