Go Down

Topic: [Fixed] Unable to upload to AtMega328 on breadboard (Read 4748 times) previous topic - next topic

GregM

Mar 02, 2011, 08:12 pm Last Edit: Mar 03, 2011, 04:02 pm by GregM Reason: 1
I've been fiddling around with the Arduino Uno and am now ready to program a ATMega328 (which I got from Sparkfun preprogrammed with the bootloader)

The followed the steps here http://arduino.cc/en/Tutorial/ArduinoToBreadboard
Removed the chip from the uno, wires it to the breadboard, added in 16Mhz xtal, 22pF caps, and applied power.

When I upload I get:
Uploading to IO board
And then after 20 secs
Problem uploading to board.
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expected=0x14, resp=0x51

Any ideas? The guide seems fairly straightforward bit I can't get it working? :(




Loudhvx

#1
Mar 02, 2011, 08:21 pm Last Edit: Mar 02, 2011, 08:45 pm by Loudhvx Reason: 1
I just did that last night (but not on the Sparkfun chips as explained below) and it worked fine, so I know it's doable.

You are uploading a sketch, correct, not the bootloader?

What is your power hookup?  The chip would not run with the reset line connected if the UNO board was not powered. I was using seperate 5v for the breadboard, so I did not share a power line with the UNO, (but still shared ground, of course). When I pulled the USB cable, the UNO would power down and lockup the chip on the breadboard.  Disconnecting the reset line, then power cycling the chip cleared that.

GregM

Correct - uploading a sketch.

Tried this guide - didnt help either.
http://www.ladyada.net/learn/arduino/help.html

A quick question - how do I know the chips I bought really have the bootloader code on them - the label says so but if it doesn't then it wont work.

I mean its supposed to be simple but its not working.

Loudhvx


Correct - uploading a sketch.

Tried this guide - didnt help either.
http://www.ladyada.net/learn/arduino/help.html

A quick question - how do I know the chips I bought really have the bootloader code on them - the label says so but if it doesn't then it wont work.

I mean its supposed to be simple but its not working.


Can you put the chip directly into the UNO? That would test it.

Loudhvx

I also just got the bootloaded SparkFUn atmega328.But I haven't tried it yet.

I'll try to test it later at work.

I was using the chip pulled out of the UNO.

GregM


Can you put the chip directly into the UNO? That would test it.


Should that work? I've tried 2 chips and put them into the Uno and tried to program my sketch. Both fail.

I can only upload my sketch to the Uno  with the original 328 in it.

Tried powering from a external 5V and using the 5V from the Uno. Didnt make any difference.

Also tried using the breadboard.zip file and using the simple circuit which doesnt require the xtal and cap - still not working.

retrolefty

What board are you selecting before attempting to upload a sketch to your breadboard 328 chip? As the sparkfun chip doesn't contain the uno bootloader but rather the older standardard 328 bootloader running at slower baudrate you must select the board type in the IDE that matches the chip's bootloader.

Lefty

GregM


What board are you selecting before attempting to upload a sketch to your breadboard 328 chip? As the sparkfun chip doesn't contain the uno bootloader but rather the older standardard 328 bootloader running at slower baudrate you must select the board type in the IDE that matches the chip's bootloader.

Lefty


The 328's I got from Sparkfun  say "Atmega328 with Arduino bootloader"

I'm using the "Arduino Duemilanove or Nano w/ ATmega328" in the IDE.

retrolefty

That's correct, must be something else.

Loudhvx

I was under the impression that the SparkFun atmega328 with Arduino bootloader pre-burned was able to go into the socket on the UNO and work just like the original UNO.

The only thing to keep straight is to put the chip into the socket the correct way. Note the chip has a little tongue-shaped cutout on one end. This lines up with the tongue-shaped cutout on the socket (away from the USB connection side).

But I haven't tried mine yet. I'll try that later today too.


GregM


I was under the impression that the SparkFun atmega328 with Arduino bootloader pre-burned was able to go into the socket on the UNO and work just like the original UNO.


Nope - not mine. Will be interesting to see if yours do. I"ve now tried all 3 I purchased.

Loudhvx

So when I test the Sparkfun chips, I should select Duemilanove as the board?

I'll try that too, then.

GregM

Yes - select "Arduino Duemilanove or Nano w/ ATmega328"

Loudhvx

I think I read last night, a thread showing how to install the new Optiboot bootloader onto a 328 using the UNO board.  I may have to try this too if the Sparkfun chips are really using the older bootloader.

GregM


I think I read last night, a thread showing how to install the new Optiboot bootloader onto a 328 using the UNO board.  I may have to try this too if the Sparkfun chips are really using the older bootloader.


Hopefully they dont have older bootloader otherwise I want a refund from Sparkfun :)

Go Up