Keil™, An ARM® Company

Technical Support

DSCOPE: INCORRECT CODE BANK SELECTED AT STARTUP


Information in this article applies to:

  • C51 Version 5.50

SYMPTOMS

I am developing a project that uses code banking, with P1 providing the bank selection signals. When I load my project into dScope it displays the following in the Module window:

B02:0000H  LJMP 0x57F
B02:0003H  MOV A,0x17
...

dScope is indicating that my startup code is in Bank 2 not the Common Area.

If I set a watchpoint on P1 and step through my code it remains at FFH and does not get initialized to select Bank 0.

CAUSE

The 'B02' indicates the currently selected code bank, which may or may not contain the current code location. In this case location 0000H cannot be in Bank 2, and must always be in the Common Area.

When the device is reset P1 is set to FFH. This will select the highest bank in your project, which in this case is Bank 2. That is the reason why 'B02' is being shown in the Module window. Initially execution starts off in the Common Area and the currently selected code bank is irrelevent.

If you step through your code until you reach a bank switch you will see P1 is initialized to the correct code bank.

MORE INFORMATION

Last Reviewed: Friday, July 15, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure