Go Down

Topic: Unable to Upload to Sketch to ATmega 328P-PU (Read 1 time) previous topic - next topic

waymond91

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

Nick Gammon

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

Threads merged.

- Moderator
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

retrolefty

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

Tumbleweed

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
Einstein once said you don't really understand anything until you can explain it to your Grandmother

retrolefty


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

Tumbleweed

Yep, .1uf, need to check my typing better.
Thanks for the correction.
Einstein once said you don't really understand anything until you can explain it to your Grandmother

cjdelphi

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

waymond91


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?


cjdelphi



See the crystals and how they're hooked up?

JD3

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

JoeO

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

Go Up