Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

CHAPTER 4

MEMORY PARTITIONS

This chapter describes the organization of the address space, its major partitions, and the 2-Mbyte and 64-Kbyte operating modes. 2-Mbyte refers to the address space defined by the 21 external address pins. In 2-Mbyte mode, code can execute from almost anywhere in the 2-Mbyte space. In 64-Kbyte mode, code can execute only from the 64-Kbyte area FF0000–FFFFFFH. The 64Kbyte mode provides compatibility with software written for previous 16-bit MCS® 96 microcontrollers. In either mode, nearly all of the 2-Mbyte address space is available for data storage.

Other topics covered in this chapter include the following:

the relationship between the 2-Mbyte address space defined by the 21 external address pins and the 16-Mbyte address space defined by the 24 internal address bits

extended and nonextended data accesses

a windowing technique for accessing the upper register file and peripheral special-function registers (SFRs) with direct addressing

a method for remapping the upper 7 Kbytes of internal ROM (FF2400–FF3FFFH)

4.1MEMORY MAP OVERVIEW

With 24 internal address bits, the microcontroller can address 16 Mbytes of memory. However, only 21 of the 24 address bits are implemented by external pins: A20:0 in demultiplexed mode, or A20:16 and AD15:0 in multiplexed mode. If, for example, an internal 24-bit address is FF2080H, the 21 external-address pins output 1F2080H. Further, the address seen by an external device depends on how many of the extended address pins are connected to the device. (See “Internal and External Addresses” on page 15-1.)

The 21 external-address pins can address 2 Mbytes of external memory. For purposes of discussion only, it is convenient to view this 2-Mbyte address space as thirty-two 64-Kbyte pages, numbered 00H–1FH (see Figure 4-1 on page 4-2). The lower 16 address pins enable the microcontroller to address external page 00H. The five extended address pins enable the microcontroller to address the remaining external address space, pages 01H–1FH.

Because the 3 most-significant bits (MSBs) of the internal address can take any values without changing the external address, these 3 bits effectively produce 8 copies of the 2-Mbyte address space, for a total of 16 Mbytes in 256 pages, 00H–FFH (Figure 4-1). For example, page 01H has 7 duplicates: 21H, 41H, …, E1H, and page 11H has 7 duplicates: 31H, 51H, …, F1H. The shaded areas in Figure 4-1 represent the overlaid areas.

4-1

8XC196EA USER’S MANUAL

 

16 Mbyte

 

3 Mbyte

2 Mbyte

 

1 Mbyte

 

 

 

 

 

 

 

 

 

 

FFH

 

2FH

 

1FH

 

0FH

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• • •

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F1H

 

21H

 

11H

 

01H

 

 

 

 

 

 

 

 

 

 

 

F0H

 

20H

 

10H

 

00H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Externally

 

 

 

 

 

 

Addressable

 

 

 

 

 

 

 

 

A3222-01

 

 

 

 

 

 

 

 

 

Figure 4-1. 16-Mbyte Address Space

The memory pages of interest are 00H–1EH and FFH. Pages 01H–1EH are external memory with unspecified contents; they can store either code or data. Pages 00H and FFH, shown in Figure 4-2, have special significance. Page 00H contains the register file and the special-function registers (SFRs), while page FFH contains special-purpose memory (chip configuration bytes and interrupt vectors) and program memory. The microcontroller fetches its first instruction from location FF2080H (or 1F2080H in external memory).

NOTE

Because the microcontroller has 24 bits of address internally, all programs must be written as though it uses all 24 bits. The microcontroller resets from page FFH, so all code must originate from this page. (Use the assembler directive, “cseg at 0FF xxxxH.”) This is true even if your code is actually stored in external memory.

4-2

FFFFFFH

FFF800H

FFF7FFH

FF2080H

FF207FH

FF2000H

FF1FFFH

FF1000H

FF0FFFH

FF0400H

FF03FFH

FF0000H

Page FFH

Internal Code RAM (CCB1.1=1) or External Memory (CCB1.1=0)

External

Program Memory

External

Special-purpose Memory (CCBs and interrupt vectors)

External Memory

External Memory

Reserved

MEMORY PARTITIONS

 

 

Page 00H

00FFFFH

Internal Code RAM

 

 

00F800H

 

00F7FFH

 

 

 

External Memory

00F000H

 

 

00EFFFH

 

 

 

External Memory

002000H

 

001FFFH

 

 

 

Peripheral SFRs††

001F00H

 

001EFFH

External Memory

 

 

 

 

(future SFR expansion)

001C00H

 

001BFFH

 

External Memory

 

 

000400H

 

0003FFH

 

Reserved

 

 

000200H

(future expansion)

 

0001FFH

 

Upper Register File††

000100H

 

0000FFH

Lower Register File

000000H

 

Can be windowed by WSR1

†† Can be windowed by WSR or WSR1

A3052-02

Figure 4-2. Pages FFH and 00H

4-3

Соседние файлы в предмете Электротехника