0
Offline
Jr. Member
Karma: 0
Posts: 80
Arduino rocks
|
 |
« on: March 02, 2011, 02:12:41 pm » |
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/ArduinoToBreadboardRemoved 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? 
|
|
|
|
« Last Edit: March 03, 2011, 10:02:55 am by GregM »
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 77
|
 |
« Reply #1 on: March 02, 2011, 02:21:25 pm » |
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
Jr. Member
Karma: 0
Posts: 80
Arduino rocks
|
 |
« Reply #2 on: March 02, 2011, 02:27:33 pm » |
Correct - uploading a sketch. Tried this guide - didnt help either. http://www.ladyada.net/learn/arduino/help.htmlA 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
Jr. Member
Karma: 0
Posts: 77
|
 |
« Reply #3 on: March 02, 2011, 02:28:24 pm » |
Correct - uploading a sketch. Tried this guide - didnt help either. http://www.ladyada.net/learn/arduino/help.htmlA 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
Jr. Member
Karma: 0
Posts: 77
|
 |
« Reply #4 on: March 02, 2011, 02:30:54 pm » |
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
Jr. Member
Karma: 0
Posts: 80
Arduino rocks
|
 |
« Reply #5 on: March 02, 2011, 02:33:34 pm » |
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
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #6 on: March 02, 2011, 02:34:52 pm » |
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
Jr. Member
Karma: 0
Posts: 80
Arduino rocks
|
 |
« Reply #7 on: March 02, 2011, 02:37:09 pm » |
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
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #8 on: March 02, 2011, 02:38:31 pm » |
That's correct, must be something else.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 77
|
 |
« Reply #9 on: March 02, 2011, 02:39:04 pm » |
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
Jr. Member
Karma: 0
Posts: 80
Arduino rocks
|
 |
« Reply #10 on: March 02, 2011, 02:40:37 pm » |
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
Jr. Member
Karma: 0
Posts: 77
|
 |
« Reply #11 on: March 02, 2011, 02:41:24 pm » |
So when I test the Sparkfun chips, I should select Duemilanove as the board?
I'll try that too, then.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 80
Arduino rocks
|
 |
« Reply #12 on: March 02, 2011, 02:42:38 pm » |
Yes - select "Arduino Duemilanove or Nano w/ ATmega328"
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 77
|
 |
« Reply #13 on: March 02, 2011, 02:44:30 pm » |
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
Jr. Member
Karma: 0
Posts: 80
Arduino rocks
|
 |
« Reply #14 on: March 02, 2011, 02:47:59 pm » |
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 
|
|
|
|
|
Logged
|
|
|
|
|
|