How to program multiple Arduinos at once using SPI?

Hello guys, is there a way to program multiple Arduinos at once using SPI? I mean they can be programmed sequentially, not literally at once, but using one spi bus? How such a thing can be achieved? Cheers

If your sketch doesn't use pins 11, 12, or 13 you might be able to use separate output pins to the Reset pins on the ICSP headers while the other 5 pins of the ICSP header are common. You would need some way to tell your "Arduino as ISP" sketch which of the arduinos you wanted to program.

The nice thing is that the sketch would be the same on all Arduinos - jumper on the pcb tell them exactly what part of the code process. What do you mean

johnwasser:
If your sketch doesn't use pins 11, 12, or 13

You mean sketch that would be uploaded?

Ok, got you now. Just done some testing. I have question. Cause I wanted to use those pins in my program as spi communication pins with some another device - nothing crucial, just few "messages" once 15 minutes or something. Can I just arbitrarly assign another Arduino pins so those hardware spi wold left for programming?

Cheers

spi is a bus. connect them all in parallel, the thing that differentiates them is the unique pin for each device, either as Reset for the devices being programmed, or as chip select/slave select to the other devices.

Are ones being programmed going to be active on SCK/MOSI/MISO once they are programmed? Then you might want to consider using other pins and sofware spi (faking what the hardware is doing) to the other devices.

Hardware SPI is on specific pins, and can't be reassigned in 328/1284/2560 devices.

Awesome, that's what I was asking. Yes, Arduino, once programmed would become a "controller". So I just have to declare another pins as spi, right?
As for CS pin - it doesn't take a part in programming via spi right?

szawus:
Awesome, that's what I was asking. Yes, Arduino, once programmed would become a "controller". So I just have to declare another pins as spi, right?
As for CS pin - it doesn't take a part in programming via spi right?

You can't move the hardware SPI to other pins. You will have to use Software SPI if your sketch needs to use SPI.
Pin 10 (hardware SS) is not used for ICSP so you can use it without interfering with ICSP.

Thanks. So Some additional library is needed? Or just pins declarations have to be changed?