Pages: [1] 2 3   Go Down
Author Topic: Upload Sketch using ISP - Is possible ?  (Read 2750 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good Morning i've seen how to uploader a bootloader via isp on atmega,

but after a look research I didn't i see on the web how to upload a sketch via ISP,

this could be more comfortable, because will be not necessary unmount the CPU each time for test,

Could someone help me ?

How ever thanks in advance for help,

Regards,
gnux
Logged

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

Good Morning i've seen how to uploader a bootloader via isp on atmega,

but after a look research I didn't i see on the web how to upload a sketch via ISP,

this could be more comfortable, because will be not necessary unmount the CPU each time for test,

Could someone help me ?

How ever thanks in advance for help,

Regards,
gnux

The Arduino IDE now has an option under the main files options to load a sketch via a ISP programmer. You just first select the programmer you are going to use in the tools menu then load up your sketch and then select upload using programmer in the files menu. Works great, but keep in mind that this erases any bootloader that may have already been on the chip and you would need to reburn the bootloader if you ever wished to upload using the normal USB serial link.

Lefty
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the info :-) for example I would like upload via isp using Arduino Uno connected via isp Arduino 2560 is possible ? where Arduino uno is connected to my computer ... so I'm using MAC OSX

So I've tried to upload a simple example and I've choose like Arduino: Arduino 2560 because is where i want to upload the sketch but I received this message:

Quote
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

Could you help kindly me ?

Thanks
Gnux
Logged

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

Thanks for the info :-) for example I would like upload via isp using Arduino Uno connected via isp Arduino 2560 is possible ? where Arduino uno is connected to my computer ... so I'm using MAC OSX

So I've tried to upload a simple example and I've choose like Arduino: Arduino 2560 because is where i want to upload the sketch but I received this message:

Quote
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

Could you help kindly me ?

Thanks
Gnux

Did you first load the arduinoISP sketch into the Uno and then select Arduino as ISP as the programmer type in the tools menu, and then properly wire the Uno to the mega board for ISP programming? There are quite a few steps and any misstep along the line can prevent success. There are step by step guides available if you search them out.

Lefty
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok but how can do if my sketch is greater than 32.256 bytes of course my arduino destination is arduino mega 2560 ... i need to use Arduino 2560 for both ?

could you tell me kindly where i can found an explanation ?

so is a little bit that I'm fighting with this issues ....


Thanks :-)
Gnux
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok but how can do if my sketch is greater than 32.256 bytes of course my arduino destination is arduino mega 2560 ... i need to use Arduino 2560 for both ?
You are not uploading the sketch to the Uno, so that specific size constraints does not apply.

As retro pointed out:
- Did you Select Uno as the target board?   (Tools -> Board)
- Did you select the correct serial port for the Uno board?   (Tools -> Serial Port)
- Did you upload the ArduinoISP sketch to your Uno?    (File -> Upload)
- Did you then wire the Mega up for ISP communications with the Uno?
- Did you then select "Arduino as ISP" as the programmer?   (Tools -> Programmer)
- Did you then select Mega as the target board?   (Tools -> Board)
- Did you then select "Upload using Programmer"?   (File -> Upload using Programmer)

Failing to do any of those steps will result in any number of failures.
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 213
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This thread should be a sticky, especcially the last answer!
I was looking for a solution for my Pro Mini, but when I find the pins to connect the ISP to, I'm sure it will work.

Regarding the lost bootloader in the target device: do I have to take care of the fuses-settings?
Or it that done by the IDE?
Logged

It's not my fault when my Posts are full of Errors. This stupid autocorrection from my browser is set up for german grammar.

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

This thread should be a sticky, especcially the last answer!
I was looking for a solution for my Pro Mini, but when I find the pins to connect the ISP to, I'm sure it will work.

Regarding the lost bootloader in the target device: do I have to take care of the fuses-settings?
Or it that done by the IDE?

IF you burning the bootloader via the arduino IDE it takes care of setting the fuse bytes automatically using the fuse settings for the board selected defined in the arduino boards.txt core file.

Lefty
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi for the moment we can put the attention on From Arduino Uno Burn a Sketch VIa ISP on ATMEGA 328 PU ...

so right now I'm able to "BURN BOOT LOADER VIA ISP" Then I think that the cable it's ok.  Now I would like to Upload the Sketch also, below reported the message that I received:

Quote
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/tty.usbmodem621 -b19200 -Uflash:w:/Users/gnusso/Desktop/hex/_20130114_ServerRicevitoreNew.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/gnusso/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodem621
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

Thanks Gnux
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Quote
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/tty.usbmodem621 -b19200 -Uflash:w:/Users/gnusso/Desktop/hex/_20130114_ServerRicevitoreNew.cpp.hex:i

That tells me you did not follow the steps I laid out in an earlier post.  You did not change the board to the Mega for the upload.  You are still attempting to upload to the Uno, which will fail.

Please do yourself a favor and go back and reread my post and follow those steps one by one.  Don't skip any, don't think 'oh that one isn't important'.  Just follow directions.
Logged

Norfolk, UK.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Works great, but keep in mind that this erases any bootloader that may have already been on the chip and you would need to reburn the bootloader if you ever wished to upload using the normal USB serial link.

So that explains why i've never succeeded in uploading a sketch to my breadboard arduino using a USB to serial adaptor...

I've been burning the bootloader using a USBasp, then uploading a simple Blink sketch using 'Upload using Programmer' to test things are working - Blink works.
Then i proceed to try uploading with USB to serial adaptor and it's failed every time - always a 'resp=0x00' error message.

I've spent hours trying to get it to work.
Checking connections, changing adaptor drivers and settings and searching the internet for help and a solution.

I read this thread last night and have just reburned my 328P bootloader and successfully uploaded a sketch using the USB to serial adapter - obviously not using the USBasp to initially upload a test sketch.  smiley

Martin.

Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Works great, but keep in mind that this erases any bootloader that may have already been on the chip and you would need to reburn the bootloader if you ever wished to upload using the normal USB serial link.

So that explains why i've never succeeded in uploading a sketch to my breadboard arduino using a USB to serial adaptor...

Ayup.  Upload using Programmer will erase the bootloader.  Glad you figured it out.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I will try to follow all the steps and then I'll let you know ...

Thanks
Gnux
Logged

Wellington, New Zealand
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As retro pointed out:
- Did you Select Uno as the target board?   (Tools -> Board)
- Did you select the correct serial port for the Uno board?   (Tools -> Serial Port)
- Did you upload the ArduinoISP sketch to your Uno?    (File -> Upload)
- Did you then wire the Mega up for ISP communications with the Uno?
- Did you then select "Arduino as ISP" as the programmer?   (Tools -> Programmer)
- Did you then select Mega as the target board?   (Tools -> Board)
- Did you then select "Upload using Programmer"?   (File -> Upload using Programmer)

thanks for the above info.

I managed to get it working once but now I can't get it going again.

I have two Arduino Duemilanove's that I am testing with and I connected the two via the ICSP pins. (Can I do it this way or is the wiring wrong?)

On the target chip I want to program. Do I first have to upload the bootloader before this will work? (How do I know if board has a bootloader installed?)
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27113
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at NickGammon's writeup, I think this will help you

http://www.gammon.com.au/forum/?id=11635
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1] 2 3   Go Up
Jump to: