beautypg.com

Utility rom (specific to maxq2000), In-application programming features, Maxq family user’s guide: maxq2000 supplement – Maxim Integrated MAXQ Family Users Guide: MAXQ2000 Supplement User Manual

Page 87: In-application programming functions

background image

UTILITY ROM (SPECIFIC TO MAXQ2000)

The MAXQ2000 utility ROM includes routines that provide the following functions to application software.

• In-application programming routines for flash memory (program, erase, mass erase)

• Single word/byte copy and buffer copy routines for use with lookup tables

To provide backward compatibility among different versions of the utility ROM, a function address table is included that contains the
entry points for all user-callable functions. With this table, user code can determine the entry point for a given function as follows.

1) Read the location of the function address table from address 0800Dh in the Utility ROM.

2) The entry points for each function listed below are contained in the function address table, one word per function, in the order given

by their function numbers.

For example, the entry point for the flashEraseAll function can be determined by the following procedure.

1) functionTable = dataMemory[0800Dh]

2) flashWriteEntry = dataMemory[functionTable + 2]

Table 48. Utility ROM User Functions (for Utility ROM Version 1.01)

It is also possible to call utility ROM functions directly, using the entry points given in Table 48. Standard include files are provided for
this purpose with the MAXQ development tool set. This method calls functions more quickly, but the application may need to be recom-
piled in order to run properly with a different version of the utility ROM.

In-Application Programming Functions

Function:

flashWrite

Summary:

Programs a single word of flash memory.

Inputs:

A[0]:Word address in program flash memory to write to.
A[1]: Word value to write to flash memory.

Outputs:

Carry: Set on error and cleared on success.

Destroys:

PSF, LC[1]

Notes:

1) If the watchdog reset function is active, it should be disabled before calling this function.

2) If the flash location has already been programmed to a non-FFFF value, this function returns with an error (Carry set). To reprogram

a flash location, it must first be erased by calling flashErasePage or flashEraseAll.

MAXQ Family User’s Guide:
MAXQ2000 Supplement

FUNCTION NUMBER

FUNCTION NAME

ENTRY POINT

SUMMARY

0

flashWrite

08461h

Programs a single word of flash memory.

1

flashErasePage

08467h

Erases (programs to FFFFh) a 256-word sector of flash memory.

2

flashEraseAll

08478h

Erases (programs to FFFFh) all flash memory.

3

moveDP0

08487h

Reads a byte/word at DP[0].

4

moveDP0inc

0848Ah

Reads a byte/word at DP[0], then increments DP[0].

5

moveDP0dec

0848Dh

Reads a byte/word at DP[0], then decrements DP[0].

6

moveDP1

08490h

Reads a byte/word at DP[1].

7

moveDP1inc

08493h

Reads a byte/word at DP[1], then increments DP[0].

8

moveDP1dec

08496h

Reads a byte/word at DP[1], then decrements DP[0].

9

moveFP

08499h

Reads a byte/word at BP[Offs].

10

moveFPinc

0849Ch

Reads a byte/word at BP[Offs], then increments Offs.

11

moveFPdec

0849Fh

Reads a byte/word at BP[Offs], then decrements Offs.

12

copyBuffer

084A2h

Copies LC[0] values from DP[0] to BP[Offs].

Maxim Integrated

87