beautypg.com

Memory organization, Register space, Program stack – Maxim Integrated MAXQ Family Users Guide: MAXQ2000 Supplement User Manual

Page 9: Data sram, Program flash, Program and data memory mapping, Maxq family user’s guide: maxq2000 supplement

background image

Memory Organization

As with all MAXQ microcontrollers, the MAXQ2000 contains logically separate program and data memory spaces. All memory is inter-
nal, and physical memory segments (other than the stack and register memories) can be accessed as either program memory or as
data memory, but not both at once. The MAXQ2000 contains the following physical memory segments.

Register Space

As described in the MAXQ Family User’s Guide, register space on MAXQ microcontrollers consists of 16 register modules, each of
which can contain up to 32 registers. Of these possible 16 register modules, only 12 are used on the MAXQ2000—seven for system
registers and five for peripheral registers.

Program Stack

The MAXQ2000 provides a 16 x 16 hardware stack to support subroutine calls and system interrupts. This stack is used automatically by
CALL and RET instructions, and can also be accessed indirectly through the SP register as described in the MAXQ Family User’s Guide.

When using the in-circuit debugging features of the MAXQ2000, one word of the stack must be reserved to store the return location
when execution branches into the debugging routines in the utility ROM. If in-circuit debug will not be used, the entire stack is avail-
able for application use.

Data SRAM

The MAXQ2000 contains 1024 words (2kBytes) of on-chip data SRAM that can be mapped into either program or data space. The con-
tents of this SRAM are indeterminate after power-on reset, but are maintained during Stop mode and across non-POR resets, as long
as the V

DD

supply stays within the acceptable range.

When using the in-circuit debugging features of the MAXQ2000, the top 19 bytes (bytes 0x7ED to 0x7FF) of the SRAM must be
reserved for saved state storage and working space for the debugging routines in the utility ROM. If in-circuit debug will not be used,
the entire SRAM is available for application use.

Program Flash

The MAXQ2000 contains 32k x 16 of flash memory, which normally serves as program memory. When executing from the data SRAM or
utility ROM, this memory is mapped to data space (as 32kWords or 64kBytes) and can be used for lookup tables and similar functions.

Flash memory mapped into data space can be read from directly, like any other type of data memory. However, writing to flash memory
must be done indirectly by calling the in-application functions provided by the utility ROM. See the Utility ROM section for more details.

Program and Data Memory Mapping

Figures 2, 3, and 4 show the mapping of physical memory segments into the program and data memory space. The mapping of mem-
ory segments into program space is always the same. The mapping of memory segments into data space varies depending on which
memory segment is currently being executed from.

In all cases, whichever memory segment is currently being executed from in program space cannot be accessed in data space.

MAXQ Family User’s Guide:
MAXQ2000 Supplement

Maxim Integrated

9