Go Down

Topic: Burning bootloader on Atmega using Arduino Errors (Read 29571 times) previous topic - next topic

smeeves

Aug 23, 2011, 03:21 am Last Edit: Aug 23, 2011, 03:26 am by Xyver Reason: 1
Hey, I'm working on programming some ATMEGA 328's, and I was having great difficulty getting the AVR studio to work, and then I found this: http://arduino.cc/en/Tutorial/ArduinoToBreadboard.

I've been trying to get it to work.  I have followed all the steps, made sure my wires are in correctly, and made sure to download the necessary extras.  I'm using an Arduino Duemilanove with an ATMEGA 328 on it, and am trying to program more ATMEGA 328's.  Im using the minimal system described on the link (above), using the internal clock on the arduino.

I keep getting this message when I try to burn the bootloader on to the new chip:
Error while burning to bootloader.
avrdude: stk500_getsync(): not in sync: resp=0xf0
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xf0

Any ideas what that means?

Coding Badly


The bootloader fuse settings require an external clock.  Once the fuses are changed, the processor will not run without an external clock.  Including responding to a programmer.

Do you have a crystal + capacitors or a resonator?

smeeves

I do not.  The tutorial says that you can use the internal clock...

retrolefty

Quote
I do not.  The tutorial says that you can use the internal clock...


It's a chicken and the egg problem. If the processor has it's internal fuse set to use internal
clock then it can be used without crystal. If processor has it's internal fuse set for external clock
then you must use external crystal or resonator.

So the question you need to answer is what is the existing clock fuse setting in your chip?

If the chip came from of an existing Arduino board, then its fuse setting is set to use crystal.
If the crystal came direct from the ATMEL factory, without any prior programming then it does not
need a external crystal.

Which is your chip?

Lefty

Coding Badly

#4
Aug 23, 2011, 06:36 am Last Edit: Aug 23, 2011, 06:40 am by Coding Badly Reason: 1

Were you ever able to upload a bootloader?

Did the error occur on the very first attempt?

Quote
Be sure to select "ATmega328 on a breadboard (8 MHz internal clock)" when burning the bootloader. (If you select the wrong item and configure the microcontroller to use an external clock, it won't work unless you connect one.)


Did you have "ATmega328 on a breadboard (8 MHz internal clock)" selected when you tried to burn the bootloader?

smeeves

Yes, I had that option selected everytime.  I have 12 brand new ATMEGA 328's, and one Arduino.  I was trying with one ATmega, then I thought I might have screwed it up by using the wrong settings, so i tried a new one. SAme problem.

All my chips are new, and should be blank.

Coding Badly


Please answer the first two questions in my post.  It makes a big difference on how you will proceed.

smeeves

Yes this is my first attempt, never done it before.  No, it has never worked.

Coding Badly


The fuse settings from "ATmega328 on a breadboard (8 MHz internal clock)" look OK.  I suspect you have not yet communicated with either processor.

The most likely culprits are...

1. Arduino ISP.  If you do not get auto-reset disabled I think attempting to upload erases the Arduino ISP sketch.  How did you disable auto-reset?

2. Wiring.  How long are the wires?  Do you have a breadboard with a "broken" power bus?

To speed up your work, you may want to learn a few basic AVRDUDE commands.

smeeves

The wires and breadboard are good enough I believe... I know that the breadboard is good to go.  How do you tell if a wire is "too long" or "too short"? 

The auto reset seems like a likely culprit, how do I disable it?  (I was looking and found this:http://www.arduino.cc/en/Main/ArduinoBoardDuemilanove "The Duemilanove contains a trace that can be cut to disable the auto-reset. The pads on either side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum thread for details." 

Is that it?

And what commands, and where would I look to find them?

dc42

Upload the ArduinoISP sketch again. Then disable the auto reset by connecting a 10uF capacitor between GND and RESET. Then set the Board to "Arduino on a breadboard (8MHz clock)" and try burning the bootloader again.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Coding Badly

How do you tell if a wire is "too long" or "too short"?


I vaguely recall someone having problems with 60 cm wires.  Until you have something working, try to keep the wires 10 cm or less.

Quote
The auto reset seems like a likely culprit, how do I disable it?


For the Duemilanove, an approximately 120 ohm resistor from 5V to RESET seems to work well.

Quote
The Duemilanove contains a trace that can be cut to disable the auto-reset. The pads on either side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN".


That would be a semi-permanent method and, as far as I know, has never been required.

Quote
You may also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum thread for details.  Is that it?


Go with that option.  There are more details here...
http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection

Quote
And what commands, and where would I look to find them?


First, make certain you can run AVRDUDE from the command-line.  In my case, I have to do this...

Code: [Select]
set PATH=%PATH%;C:\Arduino\arduino-0022\hardware\tools\avr\utils\bin
set PATH=%PATH%;C:\Arduino\arduino-0022\hardware\tools\avr\bin
set PATH=%PATH%;C:\arduino\arduino-0022\hardware\tools\avr\etc


Or, if you prefer a great deal of typing, you can use a full paths...

Quote
C:\Arduino\arduino-0022\hardware/tools/avr/bin/avrdude -CC:\Arduino\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM14 -b115200 -D -Uflash:w:C:\Users\USER~1.001\AppData\Local\Temp\build4128319007689436592.tmp\sketch_aug23a.cpp.hex:i


A command like this should do nothing more than check the fuse settings (nothing is written)...

Code: [Select]
avrdude -v -v -v -v -patmega328p -cSTK500 -P\\.\COM14 -b19200

smeeves

Thank you for all your help.  I'll go test the resistor, and then get back to you.  I don't really want to un-solder some of my board.... :/

smeeves

#13
Aug 23, 2011, 10:48 pm Last Edit: Aug 23, 2011, 11:27 pm by Xyver Reason: 1
I'm getting this error when compiling the ArduinoISP code: C:\Program Files\arduino-0022\hardware\tools\avr\bin\avr-ar: wiring_analog.c.o: No such file or directory.  Reinstall maybe?

EDIT:: Got rid of that, tried the resistor and everything, and am now down to one error, not two.  avrdude: stk500_getsync(): not in sync: resp=0x15.

Where in the coding do I put this?
set PATH=%PATH%;C:\Arduino\arduino-0022\hardware\tools\avr\utils\bin
set PATH=%PATH%;C:\Arduino\arduino-0022\hardware\tools\avr\bin
set PATH=%PATH%;C:\arduino\arduino-0022\hardware\tools\avr\etc

Coding Badly

Quote
tried the resistor and everything, and am now down to one error, not two.  avrdude: stk500_getsync(): not in sync: resp=0x15


When you try to do what?  Upload the Arduino ISP sketch to your Duemilanove or upload a sketch to the breadboard processor using your Duemilanove as an ISP?


Go Up