[SOLVED] Programming ATmega328P-PU on breadboard via Arduino Uno

Hello, I am trying to learn Arduino and (maybe) make my own robot rigged by some ATmega328. So far I tried a lot of examples from Stater Kit, build Arduino on board (the simple version - chip, crystal, two capacitors and reset button with resistor) and made it run my programs (like blinking LEDs), but I am programming it inside the UNO board, then I remove the chip and put it on breadboard (simple cheat).

Now I would like just attach chip on board to UNO and send the program there directly (my laptop have no serial port, just USB).

I wired the board as in http://arduino.cc/en/Tutorial/ArduinoISP in the last image (down rigth), uploaded sketch ArduinoISP from examples, added LEDS to pins 7,8,9 (programming,error, heartbeat) and it looked OK (after upload or reset all 3 LEDS blinks quickly in row, then heartbeat start cycling dim)

But then I got lost. When I open my sketch, set Tools-programmer-Arduino as ISP and click run, it stops the heartbeat on uno and does nothing interesting. When I unconnect the breadboard and reset it, it run the old program, not the new one.

I am afraid, that I am just uploading my program to uno, not to breadboard. Where should | look, or what should I do different to reprogram the chip on breadboard (not his arduino bootloarder, just his program)?

Thanks for advices

gilhad: But then I got lost. When I open my sketch, set Tools-programmer-Arduino as ISP and click run, it stops the heartbeat on uno and does nothing interesting. When I unconnect the breadboard and reset it, it run the old program, not the new one.

What do you mean by "click run"? You should be selecting File -> Upload Using Programmer (which you can also do by holding down Shift and clicking on the Upload button).

Thank you - that was the trick :)

Hi

I have used the same connection to burn bootloader to SMD Atmega328p-au successfully but i am not able to load simple blink sketch using the below connection :

Uploading sketches to an ATmega on a breadboard. http://arduino.cc/en/Tutorial/ArduinoToBreadboard

I am getting error: "avrdude: stk500_getsync(): not in sync: resp=0x00"

Note : as instructed in tutorial(mentioned above) i have to connect RX and TX pin of Arduino uno to RX and TX pin of SMD MCU(of PCB). As i found on google that we should not use RX PIN of Arduino Uno but if i remove it then how will i upload the sketch?

Please help me out with that . how can i upload sketch to SMD (on PCB) Atmega328p-au.

Thanks for your help!

I'm hoping I'm not missing something, but the Arduino to breadboard states that the method won't work with the Arduino Uno. Is an external programmer needed to do that? For example, in this post, the author uses an Evil Mad Scientist shield:

https://www.youtube.com/watch?v=v6CAlyS5e2o&feature=youtu.be

Anyone care to chime in?

but the Arduino to breadboard states that the method won't work with the Arduino Uno.{/quote] That is old and needs to be updated.

Either way, Nick Gammon's Bootloader install sketch is the way to go. http://www.gammon.com.au/forum/?id=11635