Keil Logo Arm Logo

Discussion Forum

Problems to execute code

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Michael Bigler
Posted
13-Dec-2000 09:02 GMT
Toolset
C51
New! Problems to execute code
Hello

I'm trying to use my microcontroler-
system with the Keil-Software.

The sytem have got the following
prefereces:
- SAB 80c535
- 32k RAM
- 32k ROM
-Memory-architekture:
(external memory)
  CODE          XDATA
--------     ---------  FFFFh
|      |     |       |
| RAM  |     | RAM   |
| 32kb |     | 32kb  |
|      |     |       |
--------     ---------  8000h
|      |     |       |  7FFFh
| ROM  |     |       |
| 32kb |     ---------
|      |     | LCD   |  0001h
|      |     |       |
--------     ---------  0000h
(The RAM is physically alwayas the
same in CODE and XDATA)

In my opinion this is a von Neumann
architekture.

Facts:
The monitor (mon51) runs properly. I
can communicate with the system.
The debbugger also communicates with the
system. But something with the code
download doesn't work. dScope (DK51)
reports Error 22.
When I try it with the uV2 debugger, the
code seems to be downloaded (statusbar of
downloading counts up to 100%), but I can't
Execute them (but no errors are reported).0

In the target-options I configured that
"Off-chip-code memory" starts at 0000h and
"Off-chip XDATA memory" starts at 8000h.
This Values I used also to generate the
monitor file for de EPPROM.

Ok.. I hope that somebody have got a solution
for my problem...

Yours cincerly
Michael Bigler
Read-Only
Author
Mark Odell
Posted
13-Dec-2000 13:09 GMT
Toolset
C51
New! RE: Problems to execute code
The 8051 is a Harvard arch. chip. You get 64K of code space and 64K of xdata space. Both spaces run from 0x0000 to 0xFFFF (they overlap in address but not physically). This gives you 128KB of code + xdata. Whether you use RAM for some of your code or ROM for some of your xdata does not make it von Neumann.

- Mark

P.S. Don't forget, you also have DATA which runs from 0x00 - 0x7F and IDATA that overlaps in address and physically from 0x00 - 0x7F. IDATA does not overlap DATA from 0x80 - 0xFF if it exists as on the 8052 core machines.
Read-Only
Author
Keil Support
Posted
13-Dec-2000 16:09 GMT
Toolset
C51
New! RE: Problems to execute code
Nice memory layout illustration! I've made a modification

  CODE          XDATA
----------------------  FFFFh
|                    |
| RAM                |  Access using PSEN or RD to read
| 32kb               |  Access using WR to write
|                    |
----------------------  8000h
|      |     |       |  7FFFh
| ROM  |     |       |
| 32kb |     ---------
|      |     | LCD   |  0001h
|      |     |       |
--------     ---------  0000h

Configuring the Monitor

With this memory map, you should configure the monitor as follows:

Near the top of INSTALL.A51, you will find the following code:

INT_ADR_OFF EQU 8000H   ; INTERRUPT VECTOR OFFSET IF MONITOR
                        ; IS INSTALLED AT ADDRESS 0000H
DEF_PC_VAL  EQU 8000H   ; DEFAULT PC VALUE AFTER START UP
These values should be changed to 8000h as shown above.

When you run the install program:

* XDATASTART should be at FF
* CODESTART should be at 00

The install command line will be:

INSTALL ?? FF 00
Refer to the following knowledgebase entry for more details:

http://www.keil.com/support/docs/1221.htm


Creating Programs to Debug with MON51

When you create a program to download to the monitor in this configuration, you MUST relocate the program to start at 8000h. If you use XDATA (RAM) you must also configure the start of XDATA so that when you write to it, you don't overwrite your program.

Refer to the following knowledgebase entry to set the program start address:

http://www.keil.com/support/docs/189.htm


Downloading Programs with the Debugger

If everything was configured properly (the monitor and your program), the debugger downloads your program with NO errors. If you receive error 22, that USUALLY means that the monitor is not properly configured. Refer to the following knowledgebase entry for more details about how to check and solve that problem:

http://www.keil.com/support/docs/863.htm

Once you program is downloaded, you MAY need to type the following in the command window:

$=0x8000
This sets the program counter to 8000h.

Once that's done, you are ready to begin testing your program.

Keil Support

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.