Choice of SPI for In System Programming on AVR

Hi,

Can any SPI on an Atmega be used for ISP?

Not sure what you mean by that? There is one set of pins used for ISP programming on each avr that supports isp programming. These are typically the SPI pins.

On chips where you can remap the spi pins, that does not change the isp pins (consider that the remap register is unset when the part is reset, and the part is held in reset while being programmed via isp)

Thanks for responding but to clarify for units with multiple SPI ports does it have to be the first SPI?

Is that information missing from the datasheet?

That would be specified on the datasheet.

Which AVR part has more than one SPI port?

does it have to be the first SPI?

No way to answer that without knowing the actual chip in question and then reading the data sheet.

You can do that, or link us to a data sheet.

Datasheet doesn't say and the chip in question is the Atmega328PB

Programming is always on a specific set of pins, which may or may not be one of the SPI ports. You can't pick a different SPI port, or other random pins. (Now, you could write a bootloader that uses a random protocol on random pins if you want. That's the big "power" of a bootloader.) (as an example, the ATmega1280 has the ISP pins on non-SPI pins.)

JcanReefMan: Datasheet doesn't say and the chip in question is the Atmega328PB

Ugh. Did you even look?

First technical part of Serial Downloading... 33.9.1. Serial Programming Pin Mapping.

Thank you westfw. Coding Badly I did look, no need to get nasty and in future if you cant/wont help just keep your trap shut.

Nothing nasty there JcanReefMan - don't go reading more intent into answers than is actually there.

Ok no worries I was a bit defensive there. Sorry for that

JcanReefMan: ...no worries...

Ditto.