18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6<br />

Internal code memory consists of the 8052-BASIC’s ROM, which uses the addresses from<br />

0 to 1FFFh.<br />

External data memory beginning at 0 is also required. BASIC-52 reserves the first 512 bytes<br />

for its own use, and it stores the current BASIC-52 user program immediately above this<br />

area. <strong>The</strong> memory map allows a choice of using an 8K RAM from 0 to 1FFFh, or a 32K<br />

RAM, which uses the entire area from 0 to 7FFFh. (<strong>The</strong> 8052 also has 256 bytes of internal<br />

data memory, which the memory map doesn’t show.)<br />

Two 8K blocks of combined code/data memory are reserved beginning at 8000h. As Chapter<br />

4 showed, BASIC-52’s programming commands store programs in nonvolatile memory<br />

beginning at this location.<br />

For the input and output, or I/O, circuits described in this chapter, the memory map reserves<br />

the top block of data memory, from E000h to FFFFh. I/O interfaces include connections to<br />

buffers, latches, switches, displays, motors, or just about anything besides the system’s main<br />

memory. <strong>The</strong> I/O circuits don’t have to use this block, but BASIC-52 encourages it, since<br />

it clears external memory only up to E000h on bootup (unless you specify a lower value by<br />

saving MTOP with a PROG3 command.)<br />

Figure 6-1. Memory map for the 8052-BASIC system’s internal and external<br />

data and program memory.<br />

88 <strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!