Maxim Integrated MAXQ7666 User Manual
Page 381

Function:
programFlashEraseAll
Summary:
Erases (programs to FFFFh) all locations in program 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:
dataFlashWrite
Summary:
Write a word (2 bytes) to the data flash page (1 page = 1 word).
Inputs:
A[0]: Word address in data flash page to write to.
A[1]: Word value (2 bytes) to write to data flash.
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.
4. Command not supported.
Destroys:
A[0], LC[1]
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 page, it must first be erased by calling dataFlashErasePage or dataFlashEraseAll.
3) The function “dataFlashWrite” has no entry in the utility ROM functions table and can be called only directly using the entry point
(088F5h) given in Table 16-1.
Function:
dataFlashWriteEven
Summary:
Write a word (2 bytes) to an even address data flash page (1 page = 1 word).
Inputs:
A[0]: Word address in data flash page to write to. Addresses are translated ((A[0] << 1) | C000h) to map even
address only. Only word addresses 0–3Fh are valid.
A[1]: Word value (2 bytes) to write to data flash.
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 invalid address.
4. Command not supported.
Destroys:
A[0], LC[1], AP, APC
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 page, it must first be erased by calling dataFlashErasePage or dataFlashEraseAll.
3) The even functions make it possible to work around the asymmetric “erase two, write one” page behavior by writing to or reading
from only even addresses. By putting data only into even locations, the intrinsic two-page erase function is made to look like a sin-
gle word erase at the cost of halving the available storage.
MAXQ7665/MAXQ7666 User’s Guide
16-4
Maxim Integrated