1 in-application programming functions -3, 1 in-application programming functions – Maxim Integrated MAXQ7666 User Manual
Page 380

16.1 In-Application Programming Functions
Function:
programFlashWritePage
Summary:
Writes an entire 32-word/64-byte program flash page.
Inputs:
DP[0]: Word address in program flash page to write to.
DP[1]: Word address in data space pointing to the 32 words in SRAM that will be written into the program flash page.
Word mode assumed.
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).
4: Command not supported.
Destroys:
PSF, LC[1], ACC, 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 page, it must first be erased by calling programFlashErasePage or programFlashEraseAll.
Function:
programFlashErasePage
Summary:
Erases (programs to FFFFh) two pages (1 page = 32 words) of the program flash memory.
Inputs:
A[0]: Word address located in the page to be erased. The specified even page and the next sequential odd page
will 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 page that is being erased.
MAXQ7665/MAXQ7666 User’s Guide
16-3
Table 16-1. Utility ROM User Functions (for Utility ROM Version 1.01) (continued)
FUNCTION NUMBER
FUNCTION NAME
ENTRY POINT
SUMMARY
16
dataFlashWrite
08906h
Writes a word to the data flash memory.
17
dataFlashWriteEven
08920h
Writes a word to the data flash memory even address.
18
dataFlashErasePage
08929h
Erases two pages of data flash.
19 — —
Reserved.
20
dataFlashEraseAll
08937h
Erases the entire data flash.
21
dataFlashReadEven
0893Eh
Reads a word from the data flash memory even address.
Maxim Integrated