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?
Sorry! i am using AT89C51RD2
I made a basic 0-9 counter for try this. I used a 7 segment display and a button to count.
When i shut down the device and start again, display did not show the last value. It always started with zero.
How can i solve this?
Example: I will push the counting button 3 times and display will show 3. I will shut down the device and start again. And the display will start showing 3.
How can i do this? Should i use an external eeprom? Or can i solve this just using AT8951RD2? If i can, how to?(which codes?)
Selahattin Porsuk
the lecterer said use a constant variable!
Obviously you need some sort of non-volatile memory...
Before even beginning to think about any code, you need to think about what hardware you will use.
You do understand why you lose your data when the power is removed, don't you?
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...
What a tease!
:-)
... does the AT89C51RD2 not have a small serial eeprom? if not id DOES have a means of writing code memory
I have no intention of reading the datasheet for the OP
Erik
If it's internal, is it likely to be serial?
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.
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 :(
Don't switch back to generic 8051. A "generic" 8051 does not have any way of storing nonvolatile variables internally. But you are not using a "generic" 8051. The documentation for your specific chip will tell you what extra features your specific chip has. Have you visited the manufacturers web site and looked at the information available? What was your conclusions after an initial, quick, scan of all the documentation? How do you think you should push ahead, based on that information?
That is a virtually meaningless question!
There are literally hundreds (maybe even thousands) of chips based on the 8051 architecture; the things which distinguish them are what peripherals they have - such as NV memory!
Unfortunately, the parametric search facility doesn't include on-chip NV memory as an option :-(
http://www.keil.com/dd/search_parm.asp
Before looking at other chips, have you checked the datasheet for your specific chip?
If you really just need to preserve data while changing the battery - ie, just for a brief time - have you considered just using a large capacitor for backup power?
Possibly also putting the processor (and other parts of the system) into a low-power mode during that time...?
Changing battery was just an example
I thought to use 1F capacitor. But if user remove the power for long time. eg: a week...
And! of course i saw the datasheet of AT89C51RD2 many times in last 3 days. I saw nothing about this thread
You may have seen it, but you don't seem to have actually taken any time to study it!
www.atmel.com/.../doc4235.pdf
Right there on the front page, it says:
"• On-chip 2048 Bytes EEPROM Block for Data Storage (AT89C51ED2 Only)"
So that directly answers you question as to whether such a thing is available!
It also says:
"• 2048 Bytes Boot ROM Contains Low Level Flash Programming Routines"
So you have the facility for your code to write to the Flash.
And, on the product page in Atmel's website:
"
Of course not! Datasheets tell you the capabilities of the chip; it's up to you to think about how those capabilities could be applied to solve your particular problem
... use a constant variable!
Huh? A "constant variable"? Now there's a dichotomy!