41CL User Manual
© 2019, Systemyde International Corporation
35
During a Flash erase or write, no other accesses of the Flash memory are allowed. This
means that these functions must be running out of RAM to work. Both Flash Memory
functions check for this, and return with a
CODE=ROM
error message if this is not the
case. If you really want to use either of the Flash Memory functions you must copy the
entire
41CL Extra Functions
image to RAM and then program the MMU to use this
RAM copy of these functions
These functions cannot be used to modify to the Operating System area (the first sector in
the Flash) and will return with the
OS AREA
error message if an address in the first
sector of the Flash memory is specified as the destination.
YFERASE
(address in ALPHA register)
Executing
YFERASE
(
Erase Flash Sector
) erases an entire sector (usually 32K words,
or eight pages) of Flash memory. The address specified can lie anywhere within the
sector.
The
YFERASE
function automatically includes a 6 second delay, because the Flash erase
operation may require this much time to complete. The function will either return
immediately with an error message, without executing, or send the
ERASING
message
to the display for the entire 6 seconds before returning.
The figure below shows the formatting required for the address and data in the ALPHA
register for the
YFERASE
function. An address that is in RAM (
P5
is 8 or greater) will
return immediately with the
DST=RAM
error message.
ALPHA register
6
5
4
3
2
1
physical address
P5 P4 P3 P2 P1 P0
YFWR
(starting address pair in ALPHA register)
Executing
YFWR
(Write Flash Page) copies the contents of one 4K block (one page) of
RAM memory to a 4K block of Flash memory. This function only allows copying block
of memory that start on 4K boundaries and are 4K in length. Only physical memory
addresses are valid for this function.