Program Memory, "Code Space; Data Memory, "Data Space; General Purpose Registers; Special Function Registers - Siemens C541U User Manual

8-bit cmos microcontroller
Table of Contents

Advertisement

3.1

Program Memory, "Code Space"

The C541U has 8 Kbyte of OTP program memory which can be externally expanded up to 64
Kbytes. If the EA pin is held high, the C541U executes program code out of the internal OTP
program memory unless the program counter address exceeds 1FFF H . Address locations 2000 H
through FFFF H are then fetched from the external program memory. If the EA pin is held low, the
C541U fetches all instructions from an external 64K byte program memory.
3.2

Data Memory, "Data Space"

The data memory address space consists of an internal and an external memory space. The
internal data memory is divided into three physically separate and distinct blocks : the lower
128 bytes of RAM, the upper 128 bytes of RAM, and the 128 byte special function register (SFR)
area.
While the upper 128 bytes of data memory and the SFR area share the same address locations,
they are accessed through different addressing modes. The lower 128 bytes of data memory can
be accessed through direct or register indirect addressing; the upper 128 bytes of RAM can be
accessed through register indirect addressing; the special function registers are accessible through
direct addressing. Four 8-register banks, each bank consisting of eight 8-bit multi-purpose registers,
occupy locations 0 through 1F H in the lower RAM area. The next 16 bytes, locations 20 H through
2F H , contain 128 directly addressable bit locations. The stack can be located anywhere in the
internal data memory address space, and the stack depth can be expanded up to 256 bytes.
The external data memory can be expanded up to 64 Kbyte and can be accessed by MOVX
instructions that use a 16-bit or an 8-bit address.
Note :The registers of the USB module are accessed through special function registers in the SFR
area.
3.3

General Purpose Registers

The lower 32 locations of the internal RAM are assigned to four banks with eight general purpose
registers (GPRs) each. Only one of these banks may be enabled at a time. Two bits in the program
status word, RS0 (PSW.3) and RS1 (PSW.4), select the active register bank (see description of the
PSW in chapter 2). This allows fast context switching, which is useful when entering subroutines or
interrupt service routines.
The 8 general purpose registers of the selected register bank may be accessed by register
addressing. With register addressing the instruction op code indicates which register is to be used.
For indirect addressing R0 and R1 are used as pointer or index register to address internal or
external memory (e.g. MOV @R0).
Reset initializes the stack pointer to location 07 H and increments it once to start from location 08 H
which is also the first register (R0) of register bank 1. Thus, if one is going to use more than one
register bank, the SP should be initialized to a different location of the RAM which is not used for
data storage.
3.4

Special Function Registers

The registers, except the program counter and the four general purpose register banks, reside in
the special function register area. The special function register area consists of two portions: the
Semiconductor Group
3-2
Memory Organization
C541U
1997-10-01

Advertisement

Table of Contents
loading

Table of Contents