Maxq7667 user’s guide – Maxim Integrated MAXQ7667 User Manual

Page 308

Advertising
background image

__________________________________________________________________________________________________________

18-2

MAXQ7667 User’s Guide

SECTION 18: UTILITY ROM

The ROM in the MAXQ7667 provides routines for handling the bootloader and application code, the debug engine, and some utility

function for the user. The focus of this section is the utility function. The area of the UROM where the utility functions reside is known

as the utility ROM.

The MAXQ7667 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 in flash memory

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 in Table 18-1 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 accessed and called by the following procedure.

get_urom_table_entry:

move dpc, #1Ch

//all data pointers in word mode

move dp[0], #0800Dh

//initialize dp[0]

move bp, @dp[0]

//load function address table location in bp

move offs, #2

//load function number in offs

call @bp[offs]

//call flashEraseAll

It is also possible to call utility ROM functions directly, using the memory entry points of the function given in Table 18-1. Standard

include files are provided for this purpose with the MAXQ7667 development tool set. This method calls functions more quickly, but the

application may need to be recompiled in order to run properly with a different version of the utility ROM.

Table 18-1. Utility ROM User Functions (for Utility ROM Version 1.01)

FUNCTION

NUMBER

FUNCTION

NAME

FUNCTION

ADDRESS

TABLE OFFSET

MEMORY

ENTRY POINT

SUMMARY

0

Reserved.

1

flashWrite

0

085C0h

Writes a word to the flash memory.

2

flashErasePage

1

085C1h

Erases 1 page (256 words) in flash memory.

3

flashEraseAll

2

08563h

Erases all flash memory.

4

moveDP0

3

08572h

Reads a byte/word at DP[0] in flash memory.

5

moveDP0inc

4

08575h

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

6

moveDP0dec

5

08578h

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

7

moveDP1

6

0857Bh

Reads a byte/word at DP[1] in flash memory.

8

moveDP1inc

7

0857Eh

Reads a byte/word at DP[1] in flash memory, then increments DP[1].

9

moveDP1dec

8

08581h

Reads a byte/word at DP[1] in flash memory, then decrements DP[1].

10

moveFP

9

08584h

Reads a byte/word at BP[OFFS] in flash memory.

11

moveFPinc

10

08587h

Reads a byte/word at BP[OFFS] in flash memory, then increments OFFS.

12

moveFPdec

11

0858Ah

Reads a byte/word at BP[OFFS] in flash memory, then decrements OFFS.

13

copyBuffer

12

0858Dh

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

14

UARTloader*

13

0859Eh

This is the entry point to call the UART bootloader from an application.

15

AutoBaud*

14

085CEh

Waits for a 0x0D and measures the bit time for it, so that a value for the

baud clock can be calculated.

*See Section 8 for UART with LIN communication and Section 13 for in-system programming through UART (and JTAG).

Advertising