Upload a sketch (not a bootloader) via ISP ?

HI, till today i have uploaded a sketch to my atmega328 (on a breadboard) with arduino uno, and all was working wonderful…
Now that i dont have arduino uno (dont ask why :D)
im curious if i can upload a sketch using leonardo or uno (smd) and upload a sketch to my atmega328 on a breadboard?

I have googled a lot but for isp i could only find A LOT of stuff on how to upload a bootloader.
Now that i already have a bootloader in looking for a way to upload a sketch.

Can anyone help me?
Or do i need new arduino uno or an usb=>serial covnerter?

Yes, it is possible. The bootloader is nothing else just normal program. You can upload any program (sketch) via ICSP by the same way. Bootloader opens additional programming path - via serial line. In this case USB/serial converter is needed for connection between the device and the computer.

hmmm why is then this not working :D

The problem in your setup, wiring etc. Send detailed info about your connection.

YEs, it is just as easy as flashing a bootloader.

However, for flashing a sketch, you just choose the option "File -> Upload using programmer" in the IDE (or press Ctrl + Shift + U)

In this regard, use the UNO (DIP) or a UNO SMD as a Arduino ISP is exactly the same thing: the pins are the same, the connections are the same, the ISP sketch is the same. Don't worry.

So everithing is the same (wiering) and no RX TX connections are needed? And i can use Arduino Uno/leonardo/micro as ISP?

Ales: So everithing is the same (wiering) and no RX TX connections are needed? And i can use Arduino Uno/leonardo/micro as ISP?

I am certain it will work for the UNO SMD and Micro (they are basically the same thing, but in a different form factor), as long as you respect the same pin numbers shown in http://arduino.cc/en/Tutorial/ArduinoISP.

I am not certain about the Leonardo, but I would give it a try.

On the Leonardo the SPI pins are not 11, 12, and 13. In fact they aren't connected to any Arduino I/O pins. You have to connect via the ICSP header. "Pin 10" of the Leonardo still goes to Reset on the target processor.

Interesting.... Now i got new UNO, and i can program atmega328 via RX/TX and reset PINS with no problem... but when i tryed to upload a sketch via ISP like described http://arduino.cc/en/Tutorial/ArduinoISP dosent work.... i get errors

avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03

More interesting... now some of the atmega328 i can upload a sketch via RX/TX/Reset but on some atmega328 i get error

avrdude: verification error, first mismatch at byte 0x0000 0x62 != 0x0c avrdude: verification error; content mismatch

seems a diferent version of chip? how can i manage this?

AlxDroidDev: I am certain it will work for the UNO SMD and Micro (they are basically the same thing, but in a different form factor), as long as you respect the same pin numbers shown in http://arduino.cc/en/Tutorial/ArduinoISP.

I am not certain about the Leonardo, but I would give it a try.

I have tryed with original Arduino UNO /without MPC, but dosent work

On some UNOs you have to disable auto-reset on the device running the ArduinoISP sketch. I do that with a 1-10 uF capacitor between Reset (+) and Ground (-).

Ales: More interesting... now some of the atmega328 i can upload a sketch via RX/TX/Reset but on some atmega328 i get error

avrdude: verification error, first mismatch at byte 0x0000 0x62 != 0x0c avrdude: verification error; content mismatch

seems a diferent version of chip? how can i manage this?

No different version of chip if we're talking about ATmega328P, surely. This error seems to be related to quality of your wiring probably. Beginning of communication had passed okay. You should set more verbose output for better observation during those states.