Pages: [1]   Go Down
Author Topic: Unable to Upload to Sketch to ATmega 328P-PU  (Read 1527 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,
I recently purchases two ATmega 328P-PU Chips from Sparkfun preloaded with the optiboot. When I switch the chips onto my arduino Uno I can upload sketches from the IDE without a hitch. However, when I hook them up on my breadboard, I cannot upload the sketch and I get the following error message:

avrdude: stk500_getsync(): not in sync: resp=0x00

I found somewhere that adding 1k pullup resistors to TX/RX pins has resolved this issue in the past. So far no luck.

I have tried uploading to my breadboard from an OSEPP brand FTDI board (purchases from Frys), an FTDI cable (purchases from mad scientists for the Diavolino), and I have tried removing the chip from my arduino so that I can use the FTDI connected to the board. The error message is always the same.

If I load the "Blink" code to the chip while plugged into the UNO, and then remove the chip and power it up on the breadboard, it still cannot get the LED on IO 13 to blink...

I attached a picture of the ATmega on my breadboard. I am using the 16.000MGhz crystal. You'll notice a capacitor and resistor on the reset pin of the atmega. I swap these in and out depending on if I am trying to upload form the FTDI chip or the arduino board... Still unsure if the reset is positive or negative triggered

Any help would be great! I have not been able to find much documentation on the 328P-PU. I tried to burn a deumilanove bootloader but I got some kind eeprom/device id error when I tried using my UNO as an ISP...


* ArduinoBreadboard.jpg (64.82 KB, 960x540 - viewed 49 times.)
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18807
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

- Moderator
Logged


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

Quote
Still unsure if the reset is positive or negative triggered

Reset is negative triggered, normally pulled high. Trying to use the auto-reset pulse from your arduino board may be problematic and may be what is tripping you up. Instead you should just add a reset switch between ground and the reset pin 1 on your breadboard. The timing can be tricky but what I do is press and hold down the reset switch then press upload on the IDE and when you see the compiled sketch size reported on the IDE release the reset button.

Lefty
Logged

alabama
Offline Offline
Full Member
***
Karma: 1
Posts: 183
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

waymon91,
I use an FTDI friend from LadyAda so I can't say exactly about the cables/adapters you use but my .01uf cap goes between the reset pin and the dtr pin on my adapter, not to ground. Don't forget to cross the TX/RX lines from the adapter to the 328p-pu. I use these chips all the time, but load up bare chips from Digikey with Nick Gammons Opti-loader utility. Works like a charm. (Thanks Nick)
TomJ
Logged

Einstein once said you don't really understand anything until you can explain it to your Grandmother

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

waymon91,
I use an FTDI friend from LadyAda so I can't say exactly about the cables/adapters you use but my .01uf cap goes between the reset pin and the dtr pin on my adapter, not to ground. Don't forget to cross the TX/RX lines from the adapter to the 328p-pu. I use these chips all the time, but load up bare chips from Digikey with Nick Gammons Opti-loader utility. Works like a charm. (Thanks Nick)
TomJ

.01uf or .1uf?

 Standard arduino boards use .1uf.

Lefty
Logged

alabama
Offline Offline
Full Member
***
Karma: 1
Posts: 183
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, .1uf, need to check my typing better.
Thanks for the correction.
Logged

Einstein once said you don't really understand anything until you can explain it to your Grandmother

Offline Offline
Edison Member
*
Karma: 29
Posts: 2455
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My first post vanished.

Look at the Crystal, see how your GND connection is not even connected, it's 1 pin to the left!..

move the GND wire so it's in series with the crystal (ie, 1 pin to the right of where it is now), your chip should spring to life
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Thanks for the advice, but so far no luck!

Lefty - I've wired up a reset button like you said, and I have tried uploading sketches with the method you described. Still getting the same error message.

Tumbleweed- I am using the .1uF cap when trying to upload with my FTDI cable and breakout board... to no avail.

cjdelphi- Are you sure? I am not sure what the crystal would be doing if we were letting current pass right through it... All of the drawings/pictures I've seen have shown the the caps on the crystal connected to common, while leaving the crystal itself un-grounded. Regardless, I have tried grounding it (on both ends) still no luck...

I have tried all  of your advice in combination without any success. Again, when I plug the arduino directly into the UNO board, I can load sketches to it without a problem. So I don't understand why I cannot just use the FTDI setup I have on the UNO to program the chip on the breadboard... In addition, if I am powering the chip correctly, shouldn't the blink sketch be running when I put it on the breadboard?

Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2455
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



See the crystals and how they're hooked up?
Logged

Offline Offline
Newbie
*
Karma: 3
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How are you hooking up the FTDI cable?
Logged

That little black caterpillar you just stepped on will set you back a few bucks....

Upstate NY
Offline Offline
Full Member
***
Karma: 2
Posts: 184
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What resistor are you using in series with the LED on pin 19?  It looks like Brown Red Black which is 12 ohms.   
Logged

Pages: [1]   Go Up
Jump to: