PJRC.COM Offline Archive, February 07, 2004
Visit this page on the live site

skip navigational linksPJRC
Shopping Cart Checkout Shipping Cost Download Website
Home MP3 Player 8051 Tools All Projects PJRC Store Site Map
You are here: 8051 Tools Development Board Memory Map Search PJRC

PJRC Store
8051 Dev Board, $79
LCD 20x2 Display, $11
Serial Cable, $5
12 Volt Power, $8
More Components...
8051 Tools
Main Page
Software
PAULMON Monitor
Development Board
Code Library
89C2051 Programmer
Other Resources

Memory Map

BeginEndCodeDataApplication
00001FFFPAULMON2RAMProgram Variables Only
20007FFFRAMProgram Code (development) and Program Variables
8000F7FFFlash ROMProgram Code and Data Logging
F800FEFFPeripheralsLCD, I/O Pins, Bus Expansion Connector
FF00FFFFUnusedReduces Power (P2 defaults to 0xFF)

With SDCC, memory usage is controlled by command line options given to SDCC when it links the code. These options are typically written in the project Makefile. For example, "--code-loc 0x2000" would cause the linker to place your code at the beginning of the RAM which can be used for downloading code, and "--xram-loc 0x6000" would instruct the linker to place all your "xdata" variables beginning at 0x6000.

With AS31, your program's location is controlled by the ".org" directive within the code. Typically a ".equ" directive defines a constant near the top of the code, and subsequent ".org" directives utilize this constant to allow the code to be "moved" more easily.

Flash ROM must be erased before it is written. When you download code built between 8000 to F7FF, PAULMON2 will automatically program your code into Flash ROM (Flash programming is a procedure different from simply writing to RAM). Flash programming can only turn 1's into 0's. To turn programmed 0's back into 1's, you must erase the flash chip ('Z' Command) or a 4k sector of the flash chip. The erasure causes all the bytes in the erased area to turn back into 0xFF. If you download a new version of your program "on top of" the original, the result is usually incorrect and PAULMON2 will print an "Unable to write" error message. If this happens, simply erase the flash rom and try again (or use the RAM for development until your code is debugged).

Peripheral Mapping

BeginEndPeripheralAddressAccessFunction
F800F8FF82C55 (A, B, C) F800RD / WRPort A
F801RD / WRPort B
F802RD / WRPort C
F803WR OnlyConfig A,B,C
F900F9FF82C55 (D, E, F) F900RD / WRPort D
F901RD / WRPort E (LEDs)
F902RD / WRPort F
F903WR OnlyConfig D,E,F
FA00FAFFUser Expansion
CS2 Signal Asserted Low
User Defined
FB00FBFFUser Expansion
CS3 Signal Asserted Low
User Defined
FC00FCFFUser Expansion
CS4 Signal Asserted Low
User Defined
FD00FDFFUser Expansion
CS5 Signal Asserted Low
User Defined
FE00FEFFLCD Port FE00WR OnlyCommand Register
FE01RD OnlyStatus Register
FE02WR OnlyDisplay or CGRAM Buffer
FE03RD Only


8051 Development System Circuit Board, Paul Stoffregen
http://www.pjrc.com/tech/8051/board5/memory_map.html
Last updated: February 7, 2004
Status: finished
Suggestions, comments, criticisms: <paul@pjrc.com>