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

protecting some values while changing the battery

i m working on a project with 89c51rd2.

my problem is how to store some datas in memory...

a passwoed for example,
i store a defult value for the password when i programming.
and i want the user can change the password.
but if the user shuts down the device or wants to change batteries
then the user works the device again, the password will take the default value again.

how can i solve this?
im using C language with keil.

i cant store any values in code memory. can the data memory remember the value?

Where is the 8051's static memory?

i want to select an address an store the password there. and i wont use a default value.
But the problem is which memory of 8051 should i use, and how can i use it.

i wanna select an address and when program starting up i will check that address, if there is no value, i will store 1234 value into there as password. when user wants to change the password i will change the value of that address.

well can i select an address in code segment(or any memory space which dont forget the value) and how can i store a value into there?
eg. i wanna store a byte to FFF0 address in code segment. is it possible?

Parents
  • Before even beginning to think about any code, you need to think about what hardware you will use.
    I just know 8051 programming a bit. So i decided to use it.

    You do understand why you lose your data when the power is removed, don't you?
    Yes. I know why my data loosing. And im trying to solve it. Also i stopped my project about this problem.

    Memories that lose their data when power is lost - such as the internal RAM of an 8051 - are said to be volatile;

    Memories that do not lose their data when power is lost are said to be non-volatile.

    It should be obvious that you have 2 possible approaches here:

    1. provide some sort of "backup" supply - so that your (volatile) memory does not lose its power;

    2. use some sort of non-volatile memory - so that it does not matter that your memory loses its power.

    There are many different ways to achieve each of these - it is your job, as designer, to consider which is most appropriate to the specific requirements & constraints of your particular application...

    Thank you. I know all of them. The think i dont know is, Does a 8051 have any non-volatile memory? and how to store my data to there.
    if 8051 does not have, i will use a 26XX series eeprom. but it will place on my board :(

Reply
  • Before even beginning to think about any code, you need to think about what hardware you will use.
    I just know 8051 programming a bit. So i decided to use it.

    You do understand why you lose your data when the power is removed, don't you?
    Yes. I know why my data loosing. And im trying to solve it. Also i stopped my project about this problem.

    Memories that lose their data when power is lost - such as the internal RAM of an 8051 - are said to be volatile;

    Memories that do not lose their data when power is lost are said to be non-volatile.

    It should be obvious that you have 2 possible approaches here:

    1. provide some sort of "backup" supply - so that your (volatile) memory does not lose its power;

    2. use some sort of non-volatile memory - so that it does not matter that your memory loses its power.

    There are many different ways to achieve each of these - it is your job, as designer, to consider which is most appropriate to the specific requirements & constraints of your particular application...

    Thank you. I know all of them. The think i dont know is, Does a 8051 have any non-volatile memory? and how to store my data to there.
    if 8051 does not have, i will use a 26XX series eeprom. but it will place on my board :(

Children