USB AVR Programmer Possibly Damaged Baby-O

Something unexpected happened when I was writing new code to the flash memory of my Baby-O recently. I’m using AVRDUDE on a Mac to do all of my programming. I have written hundreds of different programs to this Baby-O with the same USB AVR Programmer and I’ve never had an issue like this.

While the programmer was writing to the flash, the progress bar stopped and I believe there was a STK500v2 timeout message that appeared. The progress bar continued on a new line and eventually finished, although very slowly. Then, during the verification process, I was informed that the lfuse bits had been changed! (from f6 to 0) I was asked if I wanted to change them back, to which I answered yes. Unfortunately, there was subsequent timeout messages that continued forever. Eventually, I canceled the process.

I was unable to connect to the Baby-O after that. Even if I use the -F option.

I grabbed a second brand new Baby-O and tried to program that one, but the programmer did the same thing! Needless to say, I was quite disappointed at having seemingly burned up $20.

I took the new Baby-O to a different computer (again, AVRDUDE on a Mac) and using a brand new USB AVR Programmer, I was able to erase the Baby-O and restore functionality. Then, using the same new USB AVR Programmer, I attempted to do the same thing with the malfunctioning Baby-O but I’m still unable to communicate with it. Whenever I try, I get the following message:

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

To which I say, ‘You’re welcome.’

So, I essentially have two questions:

Is my original USB AVR Programmer bad?
Is my original Baby-O unrecoverable?

Thanks in advance for any responses.

Hello, samueltsherman.

There are a lot of components to this problem so let me see if I understand it. Please check what I have written below and let me know if I got anything wrong:

You have two Macs, two programmers, and two Baby Orangutans.

In the past, you have used Mac 1 + Programmer 1 + Baby Orangutan 1 successfully hundreds of times.

Recently, you tried to use Mac 1 + Programmer 1 + Baby Orangutan 1 and it failed in the middle of an upload as you described. After that failure, that particular combination of devices would not work for you any more (you were unable to connect to the Baby-O).

Next, you tried to use Mac 1 + Programmer 1 + Baby Orangutan 2, but it failed in the same way as before, in the middle of an upload. After that failure, that particular combination of devices would not work for you any more (you were unable to connect to the Baby-O).

Next, you tried Mac 2 + Programmer 2 + Baby Orangutan 2, and were able to successfully erase and program Baby Orangutan 2.

Finally, you tried Mac 2 + Programmer 2 + Baby Orangutan 1, but were unable to erase Baby Orangutan 1. You posted the output from avrdude, but you did not post the command-line arguments that you passed to avrdude to invoke it. Could you please do that?

How are you powering the Baby Orangutan during these attempts to program it?

Do you have a Windows computer available? That would let us see a more detailed error message from the programmer about exactly what is going wrong during programming.

Do you have a Baby Orangutan B-328 or another model?

Please try using the “-B 3” option of avrdude during your erasing or programming attempts to set the ISP frequency back to 200 kHz (the default).

–David

I’d like to add that we do not recommend changing the fuse bits unless you are sure you know what you are doing. This includes “changing them back”. Changing the fuse bits to something invalid can make it impossible to reprogram an AVR.

Besides, that feature of avrdude that changes the fuse bits back will not work with our programmer because it has a programming timeout feature that takes it out of programming mode when it doesn’t receive any programming commands from the computer for more than about a second, which is probably much shorter than it took you to read the prompt and decide which action to take.

–David

David,

You have summarized my steps exactly.

I am using the m328 model of Baby-O.

I am providing power to the Baby-O using the USB bus itself. I’ve soldered a few male pins to the USB AVR Programmer on the VBUS (+5V) and GND connections. This seemed to be the most reliable source. I have also powering the Baby-O with a fresh set of AA batteries.

I have tried the “-B 3” command line argument with AVRDUDE with no improvement.

Basically, any avrdude command that attempts to connect to the Baby-O will result in basically the same message. Here are a couple examples:
avrdude -p m328p -c avrisp2 -P /dev/cu.usbmodem000285641 -U flash:w:test.hex
avrdude -p m328p -c avrisp2 -P /dev/cu.usbmodem000285641 -e

I do have access to a Windows XP PC. How should I prepare? Do I need to put a non-Mac firmware on the USB AVR Programmer? Install AVR-Studio?

Hello, Samuel.

It sounds like something has gone wrong with your original programmer and Baby Orangutan. I will email you directly about getting replacements.

–David