Dim Alex wrote:
> since the lack of EEPROM inside those MCUs I've to emulate it. Using an
> external EE is not an option for me and my application.
> I'm using the compiler from the WinARM tool chain and looking for an
> example that can help me to do it in a good way. I couldn't find
> anything in this forum, so far.
> Thanks in advance!
One possibility is to write to flash as if it were EEPROM. Use the
couple pages of flash to store data. If you go to the Atmel website you
should be able to find examples of writing to flash. I believe they are
made using the IAR compiler, but the functions are short enough that
they are easy to translate into GCC, if any translation is even required
(I did it a while back so I don't remember, but I at least don't recall
having any difficulties doing it).
One important thing to remember if you use those examples, the flushPage
and AT91F_Flash_Status functions MUST be in RAM for it to work. For
more information on putting functions in RAM, search the examples Martin
put together and look for ramfunc and fastrun.