Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Storing Data variable in AT89S52 Flash Memory

Status
Not open for further replies.

fubuaks

Newbie level 3
Joined
Mar 17, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
Hello,

I want to store some data variables in At89S52 flash memory. I am using Keil Compiler for coding in C. Can it be done? If Yes, what is the procedure to do it?

Thanks in advance,
Akshay Jain.
 

The S52's flash is the PROGRAM mamory, it can't be used for storing variable data ..
Try AT89S8252 or AT89S8253 ..

:wink:
IanP
 
you can use

unsigned char code a[10];

this declaration stores the data in code memory.... but store only the data which does not change in the program execution... so variables, arrays, etc are suitable to be stored in flash memory...
 
@IANP
I looked up about these, So do u mean to say that in AT89S8252 or AT89S8253 we can store data variables in internal EEPROM in these controllers. BTW I didn't see anywhere that AT89S52 Flash is only a programmable memory.

@CkShivram - If I cant change the variables declared by the syntax u mentioned, does it mean that they can be only used for things like look up tables. Actually, I want to store the variables in flash so that they dont get deleted on power off.
 

yes it is usually store the constants, and and usually used for that purpose to reduce the memory used... that difference can be seen when you compile the program without this keyword code or with the keyword code before the variable name..

you can even try writing the data to the code memory by storing the data in the variable deinfed with keyword code...

even that is possible.. or you need to use external flash eeprom like AT24c04....
 

@IANP
I looked up about these, So do u mean to say that in AT89S8252 or AT89S8253 we can store data variables in internal EEPROM in these controllers.
By all means ..


@IANP
BTW I didn't see anywhere that AT89S52 Flash is only a programmable memory.
Call it any way you like, the fact is that you can not vary contents of the FLASH, which is by the way called Code Memory (code + program constants), in opposition to the above mentioned EEPROM, which is called Data Memory and which allows you to store data as needed ..

:wink:
IanP
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top