beautypg.com

1 program memory access, 2 program memory mapping, 3 data memory access – Maxim Integrated MAX31782 User Manual

Page 10: 1 data pointers, 2 .4 .3 .1 data pointers -6

background image

MaximIntegrated 2-6

MAX31782 User’s Guide

Revision 0; 8/11

2.4.1ProgramMemoryAccess

The instructions that the MAX31782 is executing reside in what is defined as the program memory . The MMU fetches
the instructions using the program bus . The instruction pointer (IP) register designates the program memory address of
the next instruction to fetch . The IP register is read/write accessible by the user software . A write to the IP register forces
program flow to the new address on the next cycle following the write . The content of the IP register is incremented
by 1 automatically after each fetch operation . From an implementation perspective, system interrupts and branching
instructions simply change the contents of the IP register and force the op code to fetch from a new program location .

2.4.2ProgramMemoryMapping

The MAX31782’s mapping of the three memory segments (flash, SRAM, and utility ROM) as program memory is shown
in

Figure 2-2

. The mapping of memory segments into program space is always the same . When referring to memory

as program memory, all addresses are given as word addresses . The 32KWord flash memory segment is located at
memory location 0000h through 7FFFh and is logically divided into two pages, each containing 16KWords . The utility
ROM is located from location 8000h through 8FFFh, followed by the SRAM memory segment at location A000h through
A3FFh . The user code reset vector, which is the first instruction of user program code that is executed, is located at
flash memory address 0000h . User program code should always begin at this address .

2.4.3DataMemoryAccess

Data memory mapping and access control are handled by the memory management unit (MMU) . Read/write access
to data memory can be in word or in byte mode . The MAX31782 provides three pointers that can be used for indirect
accessing of data memory . The MAX31782 has two data pointers (@DPn) and one frame pointer (@BP[OFFS]) . These
pointers are implemented as registers that can be directly accessed by user software . A data memory access requires
only one system clock period .

2.4.3.1DataPointers

To access data memory, the data pointers are used as one of the operands in a MOVE instruction . If the data pointer is
used as a source, the core performs a load operation that reads data from the memory location addressed by the data
pointer . If the data pointer is used as destination, the core performs a store operation that writes data to the memory
location addressed by the data pointer . Following are some examples of setting and using a data pointer .

move DP[0], #0100h

; set pointer DP[0] to address 100h

move Acc, @DP[0]

; read data from location 100h

move @DP[0], Acc

; write to location 100h

The address pointed to by the data pointers can be automatically incremented or decremented . If the data pointer is
used as a source, the pointer can be incremented or decremented after the data access . If the data pointer is used as
a destination, the increment or decrement can occur prior to the data access . Following are examples of using the data
pointers increment/decrement features .

move Acc, @DP[0]++

; increment DP[0] after read

move Acc, @DP[1]--

; decrement DP[1] after read

move @++DP[0], Acc

; increment DP[0] before write

move @--DP[1], Acc

; decrement DP[0] before write