Programming via ISP

I’m a little confused about something, hoping someone can give me a clear-cut answer: if I have an Arduino chip with a Bootloader on it, I know that it can be programmed via serial, can it also be programmed via ISP? All I ever read is that ISP is used to upload a bootloader - is it also used for basic sketch uploads? Do you do anything different in the Arduino IDE when doing that?

Thanks!

osmosis311:
I'm a little confused about something, hoping someone can give me a clear-cut answer: if I have an Arduino chip with a Bootloader on it, I know that it can be programmed via serial, can it also be programmed via ISP? All I ever read is that ISP is used to upload a bootloader - is it also used for basic sketch uploads? Do you do anything different in the Arduino IDE when doing that?
Thanks!

Yes, you can upload a sketch using ISP. You need a separate ISP programmer. I use a USBASP ISP programmer, but even an Arduino can be programmed to do this, using the "ArduinoISP" sketch, found in the IDE under >File >Examples.
Very handy if you have a chip on a breadboard and want to upload a program to it. I made a small PCB with a ZIF socket for programming ATMega328P chips with the USBASP programmer.

To use ISP programming, in the IDE you select the relevant programmer under >Tools >Programmer, (select "Arduino as ISP" if using an Arduino with the "ArduinoISP" sketch), then select >Sketch >Upload using Programmer to upload the sketch.
There's a lot of useful info here, on Nick Gammon's site:- Atmega chip stand-alone programmer to upload .hex files

Thanks!

Now a stretch question :slight_smile:

Do you know of any stand-alone programmers that will reliably work with a 1284P?

Thanks!

osmosis311:
Thanks!
Now a stretch question :slight_smile:
Do you know of any stand-alone programmers that will reliably work with a 1284P?
Thanks!

Definitely a stretch for me. :smiley:
Sorry, I can't help there - I've only programmed ATMega328Ps and ATtiny85s so far.
The USBASP can program the 1280P and 1281P, so it might be able to. (The list that I have doesn't include the 328P, but it works fine with them.)
Hopefully someone else can answer that.

N.B. You really should have posted this thread in the "Microcontrollers" section. You would have had a better chance there, I reckon.

Good call re: forum, will do that next time.

Thanks for the help!

BTW: when using a stand-alone programmer, what programmer do you select in the IDE?

osmosis311:
Good call re: forum, will do that next time.

Thanks for the help!

BTW: when using a stand-alone programmer, what programmer do you select in the IDE?

Whichever one you're using. There are 10 listed in the IDE. USBASP is the most commonly used I think, and AVRISP MkII is the best, as far as I know.

osmosis311:
if I have an Arduino chip with a Bootloader on it, I know that it can be programmed via serial, can it also be programmed via ISP? All I ever read is that ISP is used to upload a bootloader - is it also used for basic sketch uploads?

Another tidbit you should know: whether you are uploading a bootloader or a sketch, when you upload it with a programmer using ISP, you are erasing the chip and then writing the program on the chip. So, if you have a chip with a bootloader on it, as soon as you upload a sketch using ISP, you are replacing the bootloader with the sketch. You will no longer be able to upload using regular serial and the bootloader, until you re-install the bootloader. When uploading using regular serial and the bootloader, it is a little different in that it does not erase all of the flash and wipe out itself. When you upload using the bootloader, you end up having both the sketch and the bootloader still on the chip. Did I say too much? I'm probably talking in circles.... :slight_smile:

Actually, you just perfectly answered my question! I think that was the information I've been looking for.

A bit disappointing though (don't know if that's the right word), as I wanted to make a simple, attach/detach cable of some sort for uploading sketches. If I'm using an FTDI, I guess I can solder a simple 5 pin header onto my board to mate with the FTDI for serial sketch upload...

Thanks!

osmosis311:
Actually, you just perfectly answered my question! I think that was the information I've been looking for.

A bit disappointing though (don't know if that's the right word), as I wanted to make a simple, attach/detach cable of some sort for uploading sketches. If I'm using an FTDI, I guess I can solder a simple 5 pin header onto my board to mate with the FTDI for serial sketch upload...
Thanks!

? If you have an ISP programmer, you use it to upload sketches. Isn't that what we've been discussing? You just need a 6-pin ICSP header on your board, to connect to the MOSI, MISO, SCK, RST, +5V and GND.
And not having the bootloader is a plus - you get more code space.

Thennnnn, aside from giving you the ability to upload sketches via serial, what else does a boot loader do for you? Isn't there something about a watchdog in case your program gets stuck?

osmosis311:
Thennnnn, aside from giving you the ability to upload sketches via serial, what else does a boot loader do for you? Isn’t there something about a watchdog in case your program gets stuck?

There’s a WDT fuse that can be set, but the watchdog timer can be enabled/disabled in software. The bootloader is only needed for uploading sketches via the IDE.
You can set fuses separately using avrdude if you want, too.
Burning a bootloader first with blank chips is a good way to set the fuses, then burn your sketch using ISP to overwrite the bootloader but leave the fuse settings intact.
Sounds like you need to do a bit of study. The datasheet for the part you intend to use is a good place to start.

Thanks! Appreciate the guidance.

Just to be clear: I can still use the IDE to upload sketches via ISP, right?

I went over this earlier in reply #1.

You're right. Got a bit lost.

Thanks!!!

osmosis311:
You're right. Got a bit lost.
Thanks!!!

No problem. :slight_smile:

OK, please don't kill me, I have one more question: can I hook up a 3x2 ribbon cable to the ICSP pins on an Arduino Uno (chip removed or not necessary?) and hook the other end to a 3x2 header on my breadboard, connected to the correct pins on the ATMega chip, and program it that way??

Thanks!

Mostly, except for pin 5 of the ICSP header on the programmer Arduino. Here is a step by step; I like johnwasser's method/documentation: How to burn boot loader of arduino uno r3 usin aurdino mega 2650 - Installation & Troubleshooting - Arduino Forum

Thanks!!!