Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Question about types of uController memory

2008-04-27 by Graham Davies

--- In AVR-Chat@yahoogroups.com, davec <davec2468@...> wrote:

> When and why is it advisable
> to make use of these different
> types of memory?

All program has to go into Flash; you've no choice in this matter.  You 
can also store constant data in Flash and use special instructions to 
read it out in your program.  Changing (writing to) Flash from within 
your program is very complicated and you can only do it in chunks 
(sectors).

The data manipulated by your program goes into RAM.  If you have 
constant data, you can read it from Flash, as mentioned above, or from 
EEPROM, both of which require extra work, especially if you are writing 
the software in C.

If you have data that you need to preserve when power goes away, a good 
place for it is EEPROM.  Reading and writing EEPROM is fairly 
complicated, but there is existing software to help.  If you have more 
data of this sort than will fit in EEPROM, then you can try storing it 
in Flash along with the program, but this is really quite difficult.

Graham.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.