How to burn bootloader to an Arduino Stamp 02 (mini), with an Arduino as ISP

I probably did something stupid to an old Arduino Stamp (my first Arduino, so I'm a little emotionally attached to it). I am not able to upload sketches anymore. Was fiddeling around with this library ( http://interface.khm.de/index.php/lab/experiments/arduino-frequency-counter-library/ ).

Was working great last night. I unplugged the Arduino. But now I can't seem to get the Arduino excepting new sketches anymore, it gives me:

"avrdude: verification error, first mismatch at byte 0x0000
         0x0c != 0x00
avrdude: verification error; content mismatch"

So I wanted to try to reburn the bootloader to the Stamp with an other Arduino as ISP. Did burn bootloaders to blank chips in the past, so I know that it should work, but can't get it to work with this Arduino Stamp.

I think I'm doing something wrong with the reset. If someone could post some thoughts about what could be wrong it would be much appreciated.

If someone could post some thoughts about what could be wrong it would be much appreciated.

You forgot to post the error message from your attempt to burn the bootloader. You forgot to post which board you have selected when you attempt to burn the bootloader.

Your complete right Code Badly! To hot to think right at the moment.

I get the error message:

avrdude: stk500_cmd(): programmer is out of sync

So that made me think it has something to do with the auto reset.

I use a Arduino Duemilanove (ATmega328p) as the ISP with the ISP sketch shipped with the latest IDE. I choose Arduino Mini w/ ATmega168 as the target board. And I used the build in burn bootloader feature in the IDE.

I'm not really microcontroller savvy. But I manage.

One thing about the library (frequency counter) I'm concerned about is that I believe it changes something on the ATmega that has got something to do with timer setting?. As said I am not uC savvy so I can't really tell if that was the problem to mess up the ATmega chip??

DeRaaf: I get the error message:

avrdude: stk500_cmd(): programmer is out of sync

...with the ISP sketch shipped with the latest IDE

Try this version of the ArduinoISP sketch... http://arduino.cc/forum/index.php/topic,108797.msg824488.html#msg824488

I use a Arduino Duemilanove (ATmega328p) as the ISP... So that made me think it has something to do with the auto reset.

How are you disabling auto-reset? Capacitor? Resistor?

One thing about the library (frequency counter) I'm concerned about is that I believe it changes something on the ATmega that has got something to do with timer setting?. As said I am not uC savvy so I can't really tell if that was the problem to mess up the ATmega chip??

Changes like that are not permanent. Most of the processor (like timers) is initialized to a default state on power-up.

Will try your suggestions!

Forgot that in some cases you need to disable the auto reset by using cap or resistor. Didn't do that yet.

I had a few successes reviving ATmega using the bit bang method (http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html). But was a little scared to do this because I don't fully understand the frequency counter library.

But if I understand you correctly there are no "fuses burned" by the library? Not that I think that's the case just to be sure that if all else fails I could try the BitBang methode safely.

Thank you Coding Badly.

DeRaaf: But if I understand you correctly there are no "fuses burned" by the library?

Correct.

Thank you Coding Badly.

You are welcome.