beautypg.com

Data memory, Internal space – Rainbow Electronics AT89C5132 User Manual

Page 24

background image

24

AT8xC5132

4173A–8051–08/02

Data Memory

The AT8xC5132 provides data memory access in two different spaces:

1.

The internal space mapped in three separate segments:

The lower 128 Bytes RAM segment

The upper 128 Bytes RAM segment

The expanded 2048 Bytes RAM segment

2.

The external space.

A fourth internal segment is available but dedicated to Special Function Registers,
SFRs, (addresses 80h to FFh) accessible by direct addressing mode. For information
on this segment, refer to the section “Special Function Registers”, page 31.

Figure 15 shows the internal and external data memory spaces organization.

Figure 15. Internal and External Data Memory Organization

Internal Space

Lower 128 Bytes RAM

The lower 128 Bytes of RAM (see Figure 16) are accessible from address 00h to 7Fh
using direct or indirect addressing modes. The lowest 32 Bytes are grouped into 4
banks of 8 registers (R0 to R7). Two Bits RS0 and RS1 in PSW register (see Table 27)
select which bank is in use according to Table 24. This allows more efficient use of code
space, since register instructions are shorter than instructions that use direct address-
ing, and can be used for context switching in interrupt service routines.

Table 24. Register Bank Selection

The next 16 Bytes above the register banks form a block of bit-addressable memory
space. The C51 instruction set includes a wide selection of single-bit instructions, and
the 128 Bits in this area can be directly addressed by these instructions. The bit
addresses in this area are 00h to 7Fh.

2K Bytes

Upper

128 Bytes

Internal RAM

Lower

128 Bytes

Internal RAM

Special

Function

Registers

80h

80h

00h

7FFh

FFh

00h

FFh

64K Bytes

External XRAM

0000h

FFFFh

direct addressing

addressing

0800h

7Fh

Internal ERAM

direct or indirect

indirect addressing

EXTRAM = 0

EXTRAM = 1

RS1

RS0

Description

0

0

Register bank 0 from 00h to 07h

0

1

Register bank 1 from 08h to 0Fh

1

0

Register bank 2 from 10h to 17h

1

1

Register bank 3 from 18h to 1Fh