Hello Jack,
The attached code was originally developed from AN2346, but was considerably simplified. The assembler form has been in use for a number of years. The attached files attempt to provide a C wrapper for that code.
The simplified code assumes that non-volatile parameter data need not be written very frequently, so flash wear out will not be an issue. The code erases the first page of flash (64 bytes), and then programs data to the first row (32 bytes) only. The data may consist of 1 to 32 bytes, and is always programmed from the start of the row.
Note that the PRM file must also be modified so that code is never allocated to the first flash page, and that the global buffer structure in RAM, required to be at a precise location, is not overwritten by any other global variables.
Regards,
Mac
Message Edited by bigmac on
2007-07-11 01:13 AM