microcontrollers and volatile memory

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Bright
 
Posts: 1
Joined: Mon Apr 26, 2010 9:40 am

microcontrollers and volatile memory

Post by Bright »

I can't find any info on what happens when you use an arduino to run something.

I know, that's horrible English, but it does show where I am at on this level.

Example:
1) Program Blinky LED
2) Send to arduino
3) Loads onto board
4) Light blinks until interrupted.

My question is if this is program is "sent" to the microcontroller is it permanently burned onto the chip? If so, does that mean I spent however much money on a chip so I can watch a light blink?

Or can the microcontrollers be reused by blanking their memory (is the chip volatile?)

I read someone criticizing the arduino system since the chips were pricey-ish while other systems chips costs pennies a chip.

Thanks,
Bright

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: microcontrollers and volatile memory

Post by adafruit_support_bill »

Your program is loaded into flash memory. It is non-volatile, but can be re-written with new programs.

I don't know what chips the critics are comparing to, but the Arduino platform is a very versatile and easy to use system and the Atmel microcontrollers provide a lot of bang for the buck.

Entropy
 
Posts: 472
Joined: Tue Jan 08, 2008 12:43 am

Re: microcontrollers and volatile memory

Post by Entropy »

Bright wrote:I can't find any info on what happens when you use an arduino to run something.

I know, that's horrible English, but it does show where I am at on this level.

Example:
1) Program Blinky LED
2) Send to arduino
3) Loads onto board
4) Light blinks until interrupted.

My question is if this is program is "sent" to the microcontroller is it permanently burned onto the chip? If so, does that mean I spent however much money on a chip so I can watch a light blink?

Or can the microcontrollers be reused by blanking their memory (is the chip volatile?)

I read someone criticizing the arduino system since the chips were pricey-ish while other systems chips costs pennies a chip.

Thanks,
Bright
What systems? The cheapest microcontrollers I've found are a series of PICs that run at only 4 MHz or so and have no internal timers or interrupts at about 50 cents each.

The cheapest AVRs I know of currently are the ATTiny25s, which are 8-pins and around $1 each. Many AVR-GCC designs can be "downported" to this target. I know one of my designs was prototyped in an ATMega168 and moved to a Tiny25 once I had it reasonably mature.

ATMegaXX8s are only a couple of bucks each but are near the upper range of Atmel's line in capabilities.

Program memory is not volatile. Volatile means that information is lost when power is removed. (There is volatile SRAM inside the chip, but you don't deal with that directly.)

Program memory is, however, erasable and rewritable. It's good for a few thousand write cycles at least. (Not nearly as much as for modern flash memory, but far more than nearly anyone could ever achieve on a single chip in a reasonable amount of time.)

User avatar
adshea
 
Posts: 48
Joined: Fri Nov 06, 2009 10:01 pm

Re: microcontrollers and volatile memory

Post by adshea »

From the Datasheet for the ATMegaXX8 the Flash is good for a minimum of 10,000 write cycles and the EEPROM (I don't know if any Arduino stuff uses this) is good for 100,000 which is great for things like storing parameters that differ in an application.

To put this in perspective: if you flashed this thing every 5 minutes for 8 hours a day every day it would last three and a half months before you'd reach the minimum flash cycle life.

uhe
 
Posts: 178
Joined: Mon Sep 03, 2007 4:50 pm

Re: microcontrollers and volatile memory

Post by uhe »

Bright wrote:My question is if this is program is "sent" to the microcontroller is it permanently burned onto the chip?
Maybe...
What do you do with the command that you "sent" to the arduino? Do you store it in RAM or do you write it into the internal EEPROM?
Data in the EEPROM can be restored after a power cut, data in RAM is gone.

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: microcontrollers and volatile memory

Post by zener »

Bright wrote:I read someone criticizing the arduino system
Link please? I find it hard to believe. What are they going to criticize next? The bagel? "Too round."

User avatar
hlantz
 
Posts: 115
Joined: Wed Oct 14, 2009 3:14 pm

Re: microcontrollers and volatile memory

Post by hlantz »

Another aspect worth metioning (it's not clear from your initial post if you're aware of this - if you are, I'm sorry for pointing out the obvious!) is that once programmed to your satisfaction, the Atmel chip can be removed from the Arduino board and run as a standalone processor (with the necessary power supply and oscillator, that is) in a finished circuit. You can then buy another ATmega168/328p (priced, as said, at a couple of bucks) and insert into the on-board socket, burn a bootloader onto it and start afresh.

For a rapid prototyping platform, the Arduino and its various available shields and libraries is nothing but excellent in my world.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”