|
|
|||||||
|
Aaron, that is pretty much what I thought. The bottom line is that since the PSoC flash can only be written in blocks of 64 bytes (or 128 for some new chips) you have to reserve at least one whole block if you want to use it as EEPROM. If you want to hide the details of this you can use the eeprom_read and eeprom_write functions, e.g. here is a little test program I wrote for these functions: Code:
This is writing a whole structure to the eeprom, and also using an offset into the eeprom (this is just for test purposes). When this board is powered on, it displays a number on the LCD that is one more than the last time it was powered up. Note the use of a magic number to detect the first time it was powered up after flashing. I've attached a zip file with a complete project using this code. You could use the same approach for your application. Clyde |