Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: z.s.tar.gz on November 21, 2009, 07:21:19 AM

Title: Can not program atmega644: Most likely a hardware problem?
Post by: z.s.tar.gz on November 21, 2009, 07:21:19 AM
I can not for the life of me program my atmega644. I'm using avrdude with a ponyprog type serial dongle, and no matter what I do I get this:
Code: [Select]
avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

I believe it is a hardware problem, but where should I start? I've already tested the power supply circuitry, and the regulator seems to be giving it enough power. I've also gone over the wiring what seems like a million times.

Could it be that my MCU is bad? It's brand new out of the box, so I don't think so...

Edit: I get the same error whether the programming dongle is plugged in or not, could this mean the programmer is faulty?
Title: Re: Can not program atmega644: Most likely a hardware problem?
Post by: Trumpkin on November 21, 2009, 08:55:56 AM
Could you give a link to the programmer you're using and the line you're using for Avrdude?
Title: Re: Can not program atmega644: Most likely a hardware problem?
Post by: z.s.tar.gz on November 21, 2009, 03:06:47 PM
Certainly:
http://www.sparkfun.com/commerce/product_info.php?products_id=14 (http://www.sparkfun.com/commerce/product_info.php?products_id=14)

Code: [Select]
sudo avrdude -p m644 -P /dev/ttyUSB0 -c ponyser -U eeprom:w:/home/zach/asm/phase1/ledtest.s.hex:i
Title: Re: Can not program atmega644: Most likely a hardware problem?
Post by: Trumpkin on November 21, 2009, 03:59:59 PM
Try this:
Code: [Select]
sudo avrdude -p m644 -P /dev/ttySO -c ponyser -U eeprom:w:/home/zach/asm/phase1/ledtest.s.hex:i
Title: Re: Can not program atmega644: Most likely a hardware problem?
Post by: z.s.tar.gz on November 21, 2009, 04:29:45 PM
Well you see, I use ttyUSB0 because that is my usb adapter aka my only serial port.
I get the exact same error on another computer (with a real serial port) when I do like you said with ttyS0.

edit: after checking dmesg, it turns out that something is calling itself ttyS0, I'll look into that...

edit2: ttyS0 errors out immediately, but ttyUSB0 errors out after about 20 seconds. However on another computer, (the one with a real serial port) ttyS0 errors out immediately as well.

Should it be erroring out immediately or after a delay is now my biggest question.
Title: Re: Can not program atmega644: Most likely a hardware problem?
Post by: chelmi on November 21, 2009, 06:07:46 PM
Your using a USB/Serial adapter? Apparently this is not working, see the comments on the sparkfun webpage.
Title: Re: Can not program atmega644: Most likely a hardware problem?
Post by: z.s.tar.gz on November 21, 2009, 06:30:54 PM
That was my initial thought, but I've tried it on a computer with a normal serial port and recieved the exact same results, only instantaniously as opposed to the ~20 second delay.
Title: Re: Can not program atmega644: Most likely a hardware problem?
Post by: z.s.tar.gz on November 22, 2009, 07:54:52 PM
I completely redid all the wiring, and it works now.
I'm completely baffled as to what actually was the problem, but I'm glad it works now.