skip navigational linksPJRC
Shopping Cart Download Website
Home Products Teensy Blog Forum
You are here: 8051 Tools Development Board Memory Map

PJRC Store
8051 Board, $79
LCD 128x64 Pixel, $29
LCD 16x2 Char, $14
Serial Cable, $5
9 Volt Power, $6
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 24, 2005
Status: finished
Suggestions, comments, criticisms: <paul@pjrc.com>