3 – data transfer functions, 1 – urom_movedp0, 2 – urom_movedp0inc – Maxim Integrated DS4830A Optical Microcontroller User Manual

Page 233: Ds4830a user’s guide

Advertising
background image

DS4830A User’s Guide

233

25.3 – Data Transfer Functions

The DS4830A cannot access data from the same memory segment that is currently being used for instructions.
For example, when instructions are executing from FLASH, data in FLASH cannot be accessed. The following
utility ROM functions can be used to transfer data from one memory segment to another. For example, if data in
FLASH needs to be copied to SRAM, one of these ROM functions can be called to do this transfer. This is useful
when code is executing from FLASH and access to lookup tables or non-volatile data that is stored in FLASH is
required. These functions can also be used by code running from SRAM to read data that is stored in SRAM.

Since these functions are executed from utility ROM, addresses must be specified correctly to point to the
intended memory segments. When executing from utility ROM, the memory map is illustrated in Figure

2-4

. For

example, data located at word address 0100h in the FLASH must be accessed at word address 8100h (or byte
address 8200h) when using any of the functions listed in the following sections.


25.3.1 – UROM_moveDP0

Function

UROM_moveDP0

Summary

Reads the byte/word value pointed to by DP[0].

Inputs

DP[0]: Address to read from data space (include 8000h offset if reading from flash).

Outputs

GR: Data byte/word read.

Destroys

None

Notes:

• Before calling this function, DPC should be set appropriately to configure DP[0] for byte or word mode.
• The address passed to this function should be based on the data memory mapping for the utility ROM, as

shown in Figure 25-1. When a byte mode address is used, CDA0 must be set appropriately to access
either the upper or lower half of program flash memory.

• This function automatically selects DP[0] as the data pointer before reading the byte/word value.

• Implemented as: move GR, @DP[0]

25.3.2 – UROM_moveDP0inc

Function

UROM_moveDP0inc

Summary

Reads the byte/word value pointed to by DP[0], then increments DP[0].

Inputs

DP[0]: Address to read from data space (include 8000h offset if reading from flash).

Outputs

GR: Data byte/word read.DP[0] is incremented.

Destroys

None

Notes:

• Before calling this function, DPC should be set appropriately to configure DP[0] for byte or word mode.
• The address passed to this function should be based on the data memory mapping for the utility ROM, as

shown in Figure 25-1. When a byte mode address is used, CDA0 must be set appropriately to access
either the upper or lower half of program flash memory.

• This function automatically selects DP[0] as the data pointer before reading the byte/word value.

• Implemented as: move GR, @DP[0]++

Advertising