
DS4830 User’s Guide
221
25.2 – In-Application Programming Functions
25.2.1 – UROM_flashWrite
Programs a single word of flash memory
A[0]: Word address in program flash memory to write.
A[1]: Value to write to flash memory.
Carry: Set on error and cleared on success
Notes:
This function uses two stack levels to save and restore values.
If the watchdog reset function is active, it should be disabled before calling this function.
Interrupts are disabled while in this function.
If the flash location has already been programmed to a value other than FFFFh, this function returns with an
error (Carry set). In order to reprogram a flash location, the location must first be erased by calling
UROM_flashErasePage or UROM_flashEraseAll.
25.2.2 – UROM_flashErasePage
Erases (programs to FFFFh
)
a 512-byte page of flash memory.
A[0]: Word address located in the page to be erased. (The page number is the high 8 bits of
A[0].)
Carry: Set on error and cleared on success.
PSF, LC[1], GR, AP, APC, A[0]
Notes:
If the watchdog reset function is active, it should be disabled before calling this function.
Interrupts are disabled while in this function.
When calling this function from flash, care should be taken that the return address is not in the page which is
being erased.
25.2.3 –
UROM_flashEraseAll
Erases (programs to FFFFh
)
all locations in flash memory
Carry: Set on error and cleared on success.
PSF, GR, LC[1], LC[0], AP, APC,
A[0]
Notes:
If the watchdog reset function is active, it should be disabled before calling this function.
Interrupts are disabled while in this function..
This function can only be called by code running from the RAM. Attempting to call this function while running
from the flash results in an error.
Commentaires sur ces manuels