5
\$\begingroup\$

Let's suppose that I have two AVRs connected to one ISP connector.

enter image description here To programm only one MCU in this configuration I neet to break one (or mayby several) lines goes to the MCU I don't want to be programmed in this moment.

The first line comes to mind is VCC, which would be great as I'd save power. But as we know - power will go through digital lines wich have protection diodes to VCC and GND.

So I'd choose RESET line. Any other ideas?

\$\endgroup\$
  • 2
    \$\begingroup\$ what are those diodes inside MCU1 all about? AVR's don't hve that structure on the reset pin! (all other pins, just reset is special) \$\endgroup\$ – Jasen Apr 1 '18 at 9:05
  • 2
    \$\begingroup\$ parallel programming uses 12V on reset as an activation signal, so it has no upper protection diode. \$\endgroup\$ – Jasen Apr 1 '18 at 9:08
  • 1
    \$\begingroup\$ no, on avr ISP only uses VCC and 0V, but PIC uses 12V for ISP \$\endgroup\$ – Jasen Apr 1 '18 at 9:18
  • 3
    \$\begingroup\$ ... And that's the reason everyone else uses JTAG... \$\endgroup\$ – Marcus Müller Apr 1 '18 at 10:32
  • 1
    \$\begingroup\$ You have mistakenly drawn diodes on the reset pin. These aren't available since the reset pin is used for high voltage programming to do fuse recovery. \$\endgroup\$ – Jeroen3 Apr 1 '18 at 12:24
6
\$\begingroup\$

break MOSI because that's an output back to the host and break SCK so the other MCU can't see the programming commands.

edit - this still won't work as reset will be pulsed on and off during the programming. ther other data lines also need to be broken, or reset for the other MCU(s) held low.

I guess that's why most designs use a separate programming header for each MCU.

\$\endgroup\$
  • \$\begingroup\$ MOSI is the data line FROM programmer TO MCU. Isn't it? Why do you think that it is better than RESET? \$\endgroup\$ – Roman Matveev Apr 1 '18 at 9:05
  • 2
    \$\begingroup\$ if you disconnect reset the other MCU will run and may be using the GPIO for some putpose.... \$\endgroup\$ – Jasen Apr 1 '18 at 9:07
  • \$\begingroup\$ Good point! I didn't think about it. Is that correct that RESET line goes low for all the time during programming process? \$\endgroup\$ – Roman Matveev Apr 1 '18 at 9:09
  • \$\begingroup\$ looks like you're right, I guess that's why most designs use one programming header for each MCU. \$\endgroup\$ – Jasen Apr 1 '18 at 9:15
  • \$\begingroup\$ So it looks like breaking of SCK line is sufficient. In my particular case SPI lines uses for programming only. \$\endgroup\$ – Roman Matveev Apr 1 '18 at 9:28
2
\$\begingroup\$

I think that in order to do this, you have to keep the other chip in reset to make the IO high-Z (not driven).
Usually the CS (chip select) does this, but there is no chip select available here. See reset as !CS (not chip select).

Update: This concept will not work for atmel parts. Keeping reset low only enters the programming mode. You could keep reset high on the part that you do not want to program. But you have to make sure the program does not use the SPI pins.


However, I would not go this route. I'd compare the costs of an operator changing the cable, using two programmers or using multiplexers.

\$\endgroup\$
  • 1
    \$\begingroup\$ Holding reset low while ISP-like cycles are performed on the SPI lines can result in corrupting the flash memory of the non-targeted ATmega. \$\endgroup\$ – Chris Stratton Apr 1 '18 at 17:31
  • 1
    \$\begingroup\$ @ChrisStratton - How is this possible? Holding reset low must be absolute protection. Are you talking about some bug? \$\endgroup\$ – Egor Skriptunoff Apr 1 '18 at 18:34
  • \$\begingroup\$ @EgorSkriptunoff not for ISP it isn't. Reset is low pretty much the whole time. This can be a "gotcha" when using an Arduino as an ISP adapter to program a target AVR that itself runs an SPI peripheral. Think you'll just hold the programmer in reset to "get it out of the way" without disconnecting while trying out the target program, and you can de-bootloader your held-in-reset programmer Arduino when it misinterprets the SPI traffic as ISP operations. \$\endgroup\$ – Chris Stratton Apr 1 '18 at 18:44
  • \$\begingroup\$ @ChrisStratton - This should not happen. You have to send a correct signature (which works like a password) to enter AVR programing mode. Did Atmel confirm this behavior? \$\endgroup\$ – Egor Skriptunoff Apr 1 '18 at 20:07
  • \$\begingroup\$ @EgorSkriptunoff - in this case the undesired traffic is ISP operations another ATmega, presumably the same model. But I've also personally seen it happen twice with uncorrelated SPI traffic. \$\endgroup\$ – Chris Stratton Apr 1 '18 at 20:13

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.