Pages: [1] 2 3   Go Down
Author Topic: [Fixed] Unable to upload to AtMega328 on breadboard  (Read 4296 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 145
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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? smiley-sad



« Last Edit: March 03, 2011, 10:02:55 am by GregM » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 02, 2011, 02:45:31 pm by Loudhvx » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 145
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 145
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 145
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's correct, must be something else.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 145
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

I'll try that too, then.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 145
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 145
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

Pages: [1] 2 3   Go Up
Jump to: