Why Do embedded processors have more Flash than RAM

Hi,

I cant help wonder why embedded processors have more Flash than RAM? Right now, I am working with the AT91SAM7S, it has 256K Flash and only

64K RAM. Why is this? I am assuming we cannot run out of Flash. So if I had a program greater than 64K what am I suppposed to do?

Maddy

Reply to
Maddy
Loading thread data ...

You assume wrongly. On chip Flash is almost always capable of execute-in-place. How do you expect the CPU to boot if it can't execute any code from Flash.

Why more flash than RAM, well generally that is what customers need and RAM uses a lot more silicon per byte than Flash so you might lose 8K of Flash for even K of RAM gained.

Peter

Reply to
Peter Dickerson

Usually you have more static (program code including libraries, strings) than dynamic data.

Why?

Use a controller with more (internal or external) RAM.

Andreas

Reply to
Andreas S.

Because a) SRAM is more expensive and b) the majority of the applications need less RAM than ROM.

Read the datasheet and you'll see that this processor executes it's code directly from flash. So your program can be as large as the flash size.

Meindert

Reply to
Meindert Sprang

Hi,

Obviously your concept of processors comes from PC type system where all programs run in RAM. However, in embedded microprocessors programs generally run in flash, eeprom or rom, since there is no other storage medium that is non-volatile to hold the program whilst the power is off. In embedded systems there is generally no need to run programs in RAM since they are usually dedicated to a single application and do not need the ability to run different applications. Have a look at the AVR. It does not even give you the option of running a program from RAM, it's all assumed to be data.

Phil

Reply to
Phil W

For an embedded computer just think of Flash as disk and there is always more disk than RAM. Except you can access the flash much faster than disk so you can execute code right out of the flash with out loading it in RAM as you would from a disk. That actually cuts down the amount of RAM needed. On the other hand Flash has limited write/rewrite life so your dynamic storage for temporary feequently changing data is why the RAM is there at all. Just write out to Flash what you want to keep around between power cycles, without power refreshes RAM forgets.

So Flash is disk, with limits and bennifits.

-dcb

Reply to
enguinear

Well, for one reason, every time your turn the power off to the RAM, the contents is gone, a so called volatile memory. So, you need at least all the program in the Flash to begin with, even if you want to execute it out of RAM>

Secondly and much more important, you would not want to pay for the chips if the Flash would be 64k and the SRAM 256k, it would probably be double. Last but not least, the combination 256k Flash and 64k RAM is a HUGE RAM. As the SAM7S needs the SRAM to run fast code in ARM mode a part of the SRAM is needed for that. If you look for example at the Philips LPC2000 families of ARM microcontrollers, you will find the SRAM being smaller, biggest reason is that these devices can run full speed in the high performance ARM mode from Flash. Discussions about this and other related subjects can be found in the LPC2000 forum:

formatting link
or for the SAM7S here:
formatting link
An Schwob

Reply to
An Schwob in the USA

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.