ISP programming question: Multiple independent targets

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please don't bother asking "why" or trying to suggest a different method entirely... I just want to know if this is possible:

Can I connect (permanently) 1 ISP programmer via MISO/MOSI/SCK/RST to multiple targets if I know for certain that only the intended target will be powered at the time of programming?

Clearly the answer is "no" as I have it wired now, because it doesn't work. The powered down targets still manage to interfere because I have to disconnect the serial lines from the "dead" targets before the live one will program.

I can isolate using a variety of means, EXCEPT... I have no ability to change the circuit between the ISP and target #1. They are hardwired. Please consider that an immovable object. They are connected and there's nothing I can do about that or insert between them. However, I have full control over everything "down the line" (ie the other targets). So through use of p-FETs (and i'm sure logic buffer would be a better solution) I have successfully made it so I can program target #1 without a problem (by hi-Z the others)... but, as just stated, I can't isolate #1 from the rest and so far everything I've thought of ends up in a circular argument.

Is there some trick I can do "down the line" so that the unpowered #1 isn't interfering with the programming of #n? Some use of pull-ups or a fancy dancy IC i've never heard?

Probably not, but thought I'd ask before giving up.

I'm sure someone's going to ask for a schematic. You all know how a connection between ISP and target look, so now picture those lines branching off multiple times. I have full design control over everything past #1 and consider it patently impossible to change/insert/even touch anything from #1 to the ISP.

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you done some measurements? My guess is that the upowered units are loading down the the send signals. Then there is the issue of the receive signal - apart from powering all off but the one in question, how does one determine who should get programmed?

If you can confirm it is a loading issue, then resistors in series may help to isolate the unpowered units. But, I think you're pushing shite uphill.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
apart from powering all off but the one in question, how does one determine who should get programmed?
Well... nothing. That's it... powering off all but the one to be programmed. Obviously an unpowered target won't get programmed, right? They each have independent power sources.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Have you done some measurements? My guess is that the upowered units are loading down the the send signals.
Any hints on how I'd check that. Or what you mean by "loading down"?

I get that an unpowered AVR has its i/o dioded to ground, so the intended target is seeing ground on the MISO/MOSI lines unless I hi-Z it. Which I can do on the upstream targets. Can't on #1 :( Making any changes to #1 or the ISP defeats the entire exercise. So I can't put series resistors between the #1 i/o and the "trunk" any more than I could put in a buffer and shut it down entirely.

Any trick would have to be performed down stream of that first branch.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
get that an unpowered AVR has its i/o dioded to ground, so the intended target is seeing ground on the MISO/MOSI lines unless I hi-Z it.
This is what I mean by 'loading down'.
How would I measure it? Using an oscilloscope. No oscilloscope you say? Use your sound card as a 'scope. Google 'sound card oscilloscope'.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In case this helps... the pink area is the zone I can't do anything with (add, remove, change any components, etc). The yellow area I have complete control over. Blue line represents 4 lines of course (MISO/MOSI/SCK/RST) but I drew it as one for simplicity sake.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Quote:
get that an unpowered AVR has its i/o dioded to ground, so the intended target is seeing ground on the MISO/MOSI lines unless I hi-Z it.
This is what I mean by 'loading down'.
How would I measure it? Using an oscilloscope. No oscilloscope you say? Use your sound card as a 'scope. Google 'sound card oscilloscope'.

Lets assume I do have an oscilloscope but I just don't know what you mean. Yes, of course those inputs are pulling to ground. That's the problem. Is there a solution?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Solution? Go to plan b. What's plan b? I havent thought of that yet.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unless someone's got some magic IC to pull out of their arse or some trick to pull-up the signal to offset that diode to ground... I think I'm outta luck. Oh well.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can't you have all AVR's powered up and have a separate reset line to each? That will require that all MISO/MOSI/SCK are inputs. If that's not the case then you could have one more bus line to tell all AVR's to release those lines when you are programming any of them. You have to make your own avr programmer or make some interface between the ISP programmer and the AVR's for this to work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any powered SPI device will be in 3-state whenever /CS is high. So you can connect any number of AVRs to the SPI bus providing they are all powered. Each has its own /CS (/RESET pin).

If the SPI device is not powered, the SPI lines will not be in 3-state.

You could always connect your suspect AVR via a separate 3-stateable buffer chip. However this needs power to function.

You could use 'open-drain' buffers. You will get slow risetimes and appropriate software.

David.