Go Down

Topic: Upload a sketch (not a bootloader) via ISP ? (Read 2843 times) previous topic - next topic

Ales

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?

Budvar10

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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Ales


Budvar10

The problem in your setup, wiring etc. Send detailed info about your connection.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

AlxDroidDev

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.

Some of my projects:
Shield for DS1337+, DS1624 and AT24C1024B (RTC, temp & mem): http://forum.arduino.cc/index.php/topic,126197.0.html
CHDK Camera remote shutter (BT, IR, USB): http://forum.arduino.cc/index.php?topic=295377.0

Ales

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

AlxDroidDev

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.
Some of my projects:
Shield for DS1337+, DS1624 and AT24C1024B (RTC, temp & mem): http://forum.arduino.cc/index.php/topic,126197.0.html
CHDK Camera remote shutter (BT, IR, USB): http://forum.arduino.cc/index.php?topic=295377.0

johnwasser

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.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Ales

#8
Feb 11, 2015, 05:04 pm Last Edit: Feb 11, 2015, 05:04 pm by Ales
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

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?

Ales

#10
Feb 11, 2015, 05:24 pm Last Edit: Feb 11, 2015, 05:24 pm by Ales
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

johnwasser

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 (-). 
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Budvar10

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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Go Up