We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am finding conflicting information regarding the use of Flash memory. Some information indicates that all Flash memory is for code only, while other information implys that Flash can be used for code and data both. I get the impression that data storage in Flash is something that can be done on some parts and not others, but can't find any information on manufacturers websites that clarifies the issue. Is there any good information out there that will tell me what is what? I am looking at 8051 based parts - Atmel & Philips mostly. Thanks, Scott Kelley
Oliva stated erroneously: The same block of flash memory CANNOT be written/read/erased while the code stored in the same block is executing. For this reason, most flash memory based 8051 can use the flash as code memory only. My reply may have been wrong in the choice of words, so I will rephrase: I know of no '51 with internal flash where all the flash has to be erased at once. Thus one section can be ersased and written to while the program is running in another section. This makes it possible to use a section as data storage. E. g. the Philips P89C51RD2 has the flash separated in 5 blocks 8k, 8k and 3*16k. Erik
Eric, What I am saying is that The same block of flash memory CANNOT be written/read/erased while the code stored in the same block is executing at the same time. These two actions CANNOT be taken simultaneously. What you said is right that code in one sector and data in another. But if there is only one block (block is not a page or a sector, but contains multiple sectors), the execution of the code has to be halt until the erase and write operation finished, which takes rather long, compare to normal data saving. What's more, the interrupts cannot be responsed during this time. These are the limitations for writing data to the same block. P89C51RD2 you mentioned also has both IAP and ISP. Thanks for the information. As far as I know now, Philips and SST provide '51s that can treat flash as data memory without restriction.
I think this discussion very interesting. Can anyone tell me if is it possible to save 32bits data the internal flash (Philips P89C51RD+).Since the P89C51RD is 8 bit data microcontroller, how can I save a 32 bit data? is it possible? I am using the assembly routines of IAP system programming.But with that it is only possible to save 8 bit data.I am now triyng to make code in assembly in order to save 32bits data, but its not working. Can someone help me?
"Since the P89C51RD is 8 bit data microcontroller, how can I save a 32 bit data?" The same way you do anything with 32-bit (or 16-bit) data on an 8051: you have to handle it as 4 (or 2) separate bytes. This has nothing whatsoever to do with the data being in Flash!