I actually made a prototype with multiplexing Chip select pin on Arduino, which connects to RESET pin of target board to program. When I am connecting one target board at once I am able to program it but when I am connecting multiple target boards then not able to program ICs.

I am using Nick gammon's code for programming the target Arduino using the master Arduino https://github.com/nickgammon/arduino_sketches/tree/master/Atmega_Hex_Uploader_Fixed_Filename

This is rough block diagram of multiplexing chip select pin -

block diagram of multiplexing chip select pin

I also tried connecting RESET pin of target Arduino to its chip select pin but that is also not working.

  • 1
    Which pin on the targets are you multiplexing too? I don't think they even need CS for being programmed - just a RESET, followed by the SPI communication. I'd try multiplexing the RESET pin instead, but since that is active low, it depends on your multiplexer IC.
    – towe
    Nov 10 '20 at 8:33
  • 1
    Also other Arduinos must have SPI pins disabled (= inputs), so it won't affects selected one. Otherwise you'll need 74HC(T)125 per arduino or 74HC(T)244 per two of them
    – KIIV
    Nov 10 '20 at 8:50
  • @towe MOSI, MISO, SCK pins are common between the master and all other target arduinos. The Chip select pin on master arduino (which is responsible for programming all targets) is multiplexed using 74HC4067 mux. And the output of the mux is connected to RESET of target ICs. Now the target ICs will either be programmed for the first time when the do not have any bootloader. Or reprogrammed/firmware update. In any case the hex file is firmware+bootloader file. This setup is not working.
    – Robot
    Nov 10 '20 at 9:05
  • I searched for SPI multiplexing and found out that the master's chip select pin should be connected to target's CS pin which should be pulled up. Now as RESET on target side is needed for programming mode to initialize, I connected RESET and CS pin on target. But this setup also doesnt work.
    – Robot
    Nov 10 '20 at 9:05
  • 1
    RESET should be LOW while ICSP flashing.
    – Juraj
    Nov 11 '20 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.