Forum Index > General > Ask an Evil Mad Scientist!
 Possible to download flash from ATmega328?
 |  Printable Version
By: gunhed (offline) on Wednesday, January 05 2011 @ 07:53 AM PST (Read 4883 times)  
gunhed

OK - weird question here: Is it possible to download the contents of an ATmega168/328, essentially backing it up so that it can somehow be restored later?

For example: Let's say I have lost the source code to a very useful program currently residing on a 328, but I need to flash it with a different sketch temporarily, then restore that original sketch. This would be useful in the case that the chip was soldered directly onto a board - a big mess to try to replace.

Is this possible in some way, perhaps by altering an ISP programmer?
Just curious.
-Emo


Forum Henchperson
Henchperson


Status: offline

Registered: 12/30/09
Posts: 21

Profile Email    
   
By: Windell (offline) on Wednesday, January 05 2011 @ 09:32 AM PST  
Windell

Hi Emo,
Generally yes, it is possible. It's straightforward using avrdude and any ISP programmer. We use this method for production programming of our kits-- we program a chip "just right" and then read it out, and re-flash that onto many (for example) Bulbdial chips.

Here's the exception: It is possible to *lock* an AVR such that the memory contents cannot be read out without erasing the chip, using the "lock bits," which are EEPROM bits similar to the usual fuse bytes. This is a feature designed to prevent just anyone from stealing your program from a finished product. If your chip has been locked in this way, you cannot read out the memory.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Windell (offline) on Wednesday, January 19 2011 @ 05:28 AM PST  
Windell

We've posted a new article on our blog about this question.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: joeybiggs (offline) on Wednesday, November 02 2011 @ 07:37 PM PDT  
joeybiggs

I read the article and it answered most of my questions. However, I have just one quick question"

The article says

It is possible to intentionally lock the contents of the flash memory, such that the contents cannot be read out*. You can do this by setting the lock bits of the AVR according to the values listed in the datasheet, and the lock bits cannot be reset except by erasing the whole device.



So if I need to reset the lock bits, then I need to erase the whole device? Is there another way around this?

Forum Apprentice
Apprentice

Status: offline

Registered: 11/02/11
Posts: 1
San Antonio

Profile Email Website  
   
By: Windell (offline) on Wednesday, November 02 2011 @ 07:42 PM PDT  
Windell

Not that I know of.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   



 All times are PDT. The time is now 04:46 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?