BasicMicro - Forums

www.basicmicro.com
It is currently Sun May 20, 2012 11:16 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Is it possible to store anything but program code in EEPROM?
PostPosted: Thu Feb 18, 2010 1:03 pm 
Offline
Citizen

Joined: Wed Feb 10, 2010 1:09 pm
Posts: 16
So we know that EEprom is used to store the code that the mcu executes and the RAM is for storing the contents of variables.

Is there a way to store these values in EEprom? For example, a user enters in settings for a device but if the device loses power the RAM is deleted and the user would have to go back to the device and reprogram it with the settings. If there were a way to store these settings in EEprom, they'd stay through power or no power and would only be changed if the user made changes.

Any advice on this or another method of keeping something such as user settings permanent?


Top
 Profile  
 
 Post subject: Re: Is it possible to store anything but program code in EEPROM?
PostPosted: Thu Feb 18, 2010 1:20 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Hello Brock. This is how it works:
- RAM is temporary storage that goes away when power is removed. The user and the BASIC store temporary info here.
- FLASH is where program code goes, not EEPROM. The fun thing is (this is NOT true for the Pro) you can also store values here permanently in large quantities but you run the risk of writing over your code or bootloader. The first is an annoyance, the other makes your part worthless as an Atom/Nano. This is done with the READPM, WRITEPM commands. Not recommended for obvious reasons.
- EEPROM is 256 bytes of permanent storage for whatever byte-size data you want to squirrel away for ever and ever. BUT you have to reload this every time you program the Atom/Nano as the compiler erases everything before writing to the part. But after that you can turn power on and off and the data is still there. Yeah! This is done with the READ and WRITE commands.

As always you'll want to refer to the manual for these commands, on the forum eventually, or the version 3002 manual at the Download Section.
Take care.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Is it possible to store anything but program code in EEPROM?
PostPosted: Thu Feb 18, 2010 1:35 pm 
Offline
Citizen

Joined: Wed Feb 10, 2010 1:09 pm
Posts: 16
Ah there's always a BUT! I was mixing up my EEprom and Flash. I could have been more proactive and read the manual to see that the EEprom is there to store whatever you want.

Thanks again Kenjj


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO