EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Why Do embedded processors have more Flash than RAM

Started by Maddy November 2, 2005
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

"Maddy" <santhos@gmail.com> wrote in message
news:1130945007.761856.138370@g14g2000cwa.googlegroups.com...
> 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?
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
Maddy wrote:
> 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?
Usually you have more static (program code including libraries, strings) than dynamic data.
> I am assuming we cannot run out of Flash.
Why?
> So if I had a program greater than 64K what am I suppposed to do?
Use a controller with more (internal or external) RAM. Andreas
"Maddy" <santhos@gmail.com> wrote in message
news:1130945007.761856.138370@g14g2000cwa.googlegroups.com...
> 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?
Because a) SRAM is more expensive and b) the majority of the applications need less RAM than ROM.
> I am assuming we cannot run out of Flash. So if I had a program greater > than 64K what am I suppposed to do?
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
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


"Maddy" <santhos@gmail.com> wrote in message
news:1130945007.761856.138370@g14g2000cwa.googlegroups.com...
> 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 >
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

On Thu, 3 Nov 2005 07:48:18 +1100, "Phil W" <electropw@hotmail.com>
wrote:

>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 > > >"Maddy" <santhos@gmail.com> wrote in message >news:1130945007.761856.138370@g14g2000cwa.googlegroups.com... >> 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 >> >
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:
http://groups.yahoo.com/group/lpc2000/
or for the SAM7S here:
http://groups.yahoo.com/group/AT91SAM7/
An Schwob


The 2024 Embedded Online Conference