This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Storing data after reset

Hello all,
We have with us a AT89C51ED2 board with an external AT29LV020 flash.
We have our CODE in the external flash.

There are two types of data that we want to retain between system resets.
One type of variables are those which will not change when the system resets. i mean they will be constants everytime we reset the boards. so we have decided to use
const <datatype> code abc; so that they will not change and will be allocated in the ROM.

Another type is that they might change during run time, and when the system resets, it must be able to get back the last value it was when the system was reset.

For these kind of variables we write to the Internal Flash when the board resets using the IAP functions.

First thing, are we doing it right, second, Is there any other way to store this data ?


regards
prasanna

Parents
  • "First thing, are we doing it right, second, Is there any other way to store this data ?"

    Depends what you mean by 'right'. It would seem more logical to put your code in the internal flash and store your non-volatile data in the internal EEPROM. You wouldn't need to muck about with the IAP calls.

    "For these kind of variables we write to the Internal Flash when the board resets using the IAP functions."

    How do you buy the time to write these variables on reset?

Reply
  • "First thing, are we doing it right, second, Is there any other way to store this data ?"

    Depends what you mean by 'right'. It would seem more logical to put your code in the internal flash and store your non-volatile data in the internal EEPROM. You wouldn't need to muck about with the IAP calls.

    "For these kind of variables we write to the Internal Flash when the board resets using the IAP functions."

    How do you buy the time to write these variables on reset?

Children
No data