1 in-application programming functions -3, 2 data transfer functions -3, 1 in-application programming functions – Maxim Integrated MAXQ7666 User Manual
Page 372: 2 data transfer functions

15.1 In-Application Programming Functions
Function:
flashEraseSector
Summary:
Erases (programs to FFFFh) a sector of flash memory.
Inputs:
A[0]: Word address located in the sector to be erased.
Outputs:
Carry: Set on error and cleared on success. If set, then A[0] contains one of the following error codes:
1: Failure due to software timeout.
2: Failure reported by hardware (FERR).
3: Failure due to trying to erase current page.
Destroys:
PSF, LC[1], GR, ACC, AP, APC (AP = APC = 0)
Notes:
1) If the watchdog reset is enabled, user code should disable it before calling this function. Also, disable interrupts globally (IGE = 0).
2) When calling this function from flash, care should be taken that the return address is not in the sector that is being erased.
Function:
flashEraseAll
Summary:
Erases (programs to FFFFh) all locations in flash memory.
Inputs:
None.
Outputs:
Carry: Set on error and cleared on success.
Destroys:
PSF, GR, LC[0], LC[1], APC, AP, A[0] (AP, APC set to 0)
Notes:
1) If the watchdog reset is enabled, user code should disable it before calling this function. Also, disable interrupts globally (IGE = 0).
2) This function can only be called by code running from the RAM. An attempt to call this function while running from the flash results
in an error.
Function:
flashWriteA
Summary:
Writes a single word to the flash memory.
Inputs:
A[0]: Word address in code flash memory to write to.
A[1]: Word value to write to flash memory.
Outputs:
Carry: Set on error and cleared on success. If set, then A[0] contains one of the following error codes:
1: Failure due to software timeout.
2: Failure reported by hardware (DQ5).
4: Command not supported.
Destroys:
LC[1], A[2], AP
Notes:
1) If the watchdog reset is enabled, user code should disable it before calling this function. Also, disable interrupts globally (IGE = 0).
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 sector, it must first be erased by calling flashEraseSector or flashEraseAll.
15.2 Data Transfer Functions
Function:
moveDP0
Summary:
Reads the byte/word value pointed to by DP[0].
Inputs:
DP[0]: Address to read from.
Outputs:
GR: Data byte/word read.
Destroys:
Selects DP[0] in DPC.
Notes:
1) Before calling this function, DPC should be set appropriately to configure DP[0] for byte or word mode.
2) The address passed to this function should be based on the data memory mapping for the utility ROM, as explained in
Section 1.
The CDA0 and CDA1 bits must be set appropriately to access either the upper or lower half of program flash memory.
3) This function automatically refreshes the data pointer before reading the byte/word value.
MAXQ7665/MAXQ7666 User’s Guide
15-3
Maxim Integrated