1103Views8Replies

Author Options:

Remove a sketch from ATmega328 Answered

Is It possible to remove a sketch from an Arduino with a 328 using the Arduino IDE?
I have deleted the sketch from my PC.
The program is running now but no more sketch in the Arduino files.
Or is rewriting it the only way?   

8 Replies

user
allan.hogue.3 (author)2014-11-12

No controller should ever get hooked to Input and Output devices unless it is cleared of logic or has a known program that matches the hardware. Arduino is pretty much a toy but get good safety habits now. Full size robots or control systems can be dangerous.

Select as Best AnswerUndo Best Answer

user
bwrussell (author)2012-10-24

Just rewrite with a blank sketch. Is there a reason you need to do this?

I believe a blank sketch would be:
void setup()
{}
void loop()
{}

Select as Best AnswerUndo Best Answer

user
WWC (author)bwrussell2012-10-24

Maybe i wrote the question not as clear as i could.
I have a LM35 thermometer sketch with LCD readout running now on my Arduino, but i deleted the program from my computer.
I was asking if it is possible to read the program on the chip and put it back into the Arduino IDE.

Kind of a reverse programming or if the only way is to re write the sketch again.

Select as Best AnswerUndo Best Answer

user
maewert (author)WWC2012-10-25

No way to get back the original sketch. The Arduino contains the compiled image only so you could at most get back Atmega assembly language.

Sorry.

Select as Best AnswerUndo Best Answer

user
WWC (author)maewert2012-10-25

So my lesson here is be more careful when saving sketches.

Thanks

Select as Best AnswerUndo Best Answer

user
bwrussell (author)WWC2012-10-25

Yep, learn from your mistakes and keep a backup in the future.

Select as Best AnswerUndo Best Answer

user
astroboy907 (author)bwrussell2012-10-25

I believe you can acutally save the .hex file to your computer, using a programmer (e.g using an AVRISP MKII and Avr Studio)

However the resulting file will not be editable, at least not through the arduino software/language itself

Select as Best AnswerUndo Best Answer

user
WWC (author)astroboy9072012-10-25

Ah
That is getting beyond my skills at this time.
I have already re written it again.
Good for me anyway i need the practice.

Thanks

Select as Best AnswerUndo Best Answer