beautypg.com

4 memory organization, 1 register space, 2 program stack – Maxim Integrated MAXQ Family Users Guide: MAXQ8913 Supplement User Manual

Page 12: 3 data sram, 4 program flash, 5 program and data memory mapping, 4 memory organization -3, 5 program and data memory mapping -3, Maxq family user’s guide: maxq8913 supplement

background image

MAXQ Family User’s Guide:

MAXQ8913 Supplement

2-3

2.4 Memory Organization

As with all MAXQ microcontrollers, the MAXQ8913 contains logically separate program and data memory spaces. All
memory is internal, 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 MAXQ8913 contains the following physical memory segments.

2.4.1 Register Space

As described in the MAXQ Family User’s Guide, register space on MAXQ microcontrollers consists of 16 register mod-
ules, each of which could contain up to 32 registers. Of these possible 16 register modules, only 11 are used on the
MAXQ8913: seven for system registers and four for peripheral registers.

2.4.2 Program Stack

The MAXQ8913 provides a 16 x 16 hardware stack to support subroutine calls and system interrupts. This stack is used
automatically by CALL/RET and PUSH/POP instructions, and can also be accessed directly through the SP register as
described in the MAXQ Family User’s Guide.
When using the in-circuit debugging features, 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 is not used, the entire stack is
available for application use.

2.4.3 Data SRAM

The MAXQ8913 contains up to 2048 words (4KB) of on-chip data SRAM, which can be mapped into either program or
data space. The contents of this SRAM are indeterminate after power-on reset, but are maintained during stop mode
and across non-POR resets.
When using the in-circuit debugging features, the highest 19 bytes of the SRAM must be reserved for saved state stor-
age and working space for the debugging routines in the utility ROM. If in-circuit debug is not used, the entire SRAM
is available for application use.

2.4.4 Program Flash

The MAXQ8913 contains 32KWords (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 64KB) and can
be used for lookup tables and similar functions.
Since program memory is mapped into data space starting at address 8000h, only half the available program memory
can be mapped into data space at one time when operating in byte-access mode. The CDA0 (code data access) bit
is used to control which half of program memory is available in data space as shown in Figure 2-3 and Figure 2-4, and
as described in the MAXQ Family User’s Guide. When operating in word-access mode, the entire 32KWord program
memory can be mapped into data space at once.
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 Section
25:
Utility ROM for more details.

2.5 Program and Data Memory Mapping

Figures 2-2, 2-3, and 2-4 show the mapping of physical memory segments into the program and data memory space.
The mapping of memory 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 may not be accessed in
data space.

Maxim Integrated