I'm trying to program multiple Nano boards connected in a daisy chain via the ISP pins from an UNO board.
Just as a sanity check, I started by loading the example ArduinoISP sketch into the Uno, and wiring a single Nano to the SPI pins as described in many examples found on the Internets. Using this setup I'm able to program the Blink sketch into Nano as expected.
Next I wired up a second Nano (Nano-B) in a daisy chain with the first (Nano-A).
My connections:
Programming Uno Nano-A Nano-B
----------------------------------------
D10 (reset out) RST RST
SCK SCK SCK
MOSI MOSI
MISO MOSI
MISO MISO
I then modified the ArduinoISP sketch to transmit two copies of everything so they end up in both Nanos:
uint8_t spi_transaction(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
// First copy for Nano-B
SPI.transfer(a);
SPI.transfer(b);
SPI.transfer(c);
SPI.transfer(d);
// First copy for Nano-A
SPI.transfer(a);
SPI.transfer(b);
SPI.transfer(c);
return SPI.transfer(d);
}
This of course doesn't work or I wouldn't be posting here, but it seems like sound logic. I get a device signature 0f 0x000000 which points to a wiring problem (?).
I've searched the world over and haven't found an example of daisy chaining Arduino SPI programming. If you can point me to some rock I haven't looked under, or correct me on my approach please do so.
That is all.