Isolating SPI while uploading new code

I use my SPI pins to control LED strings which don't have a slave select. They simply take DATA and SCK to work. But when uploading new code through a programmer connected to the same SPI pins, it sends the LED string into a psychedelic rainbow of colors. After all, it's an SPI signal, and the LED string is interpreting it as well. So my question is, is there a way to isolate whatever is connected to the SPI bus from getting affected by the programmer as it's uploading code?

So my question is, is there a way to isolate whatever is connected to the SPI bus from getting affected by the programmer as it's uploading code?

Yes, by dip switch/any manual switch.

Which LED strings you are using?

Yeah, that's kinda hard to do in an enclosure. They're regular WS2801 strings. All they use is DATA and SCK (and VCC/GND)

You know an easy way to deal with this and cases where you need/want to use pins 0 and/or 1 (the serial pins) is to build your stuff to wire to a simple protoshield board. That way when you need to either upload via serial or perform ICSP programming with the SPI pins, you just pop the shield off, do your thing, then pop the shield back on. Proto boards in sheild format can be pretty inexpensive these days:

http://www.ebay.com/itm/Prototype-Prototyping-Shield-ProtoShield-For-Arduino-UNO-R3-/281028234209?pt=LH_DefaultDomain_0&hash=item416e968be1

http://www.ebay.com/itm/Assembled-Protoshield-for-Arduino-/120966868895?pt=LH_DefaultDomain_0&hash=item1c2a2fef9f

Lefty

That won't work in an enclosure where I need to open the thing and pull the guts out just to pull the shield off to reprogram, etc., etc. Uh, no. So basically this tells me there is no easy way to do this, electronically at least, without physically handling the hardware. Thanks. I'll figure something else out.

that's kinda hard to do in an enclosure.

Add a transistor between VCC and power source. Turn the transistor in Saturation through software but in that case one PIN resource need.

One more thing calculate all values of resistors RB RE RC etc for switching according to your case. 8)

No need, the strips come prebuilt with everything on them. Just connect SPI lines. I'll try a transistor or FET to cut VCC from the strips.

Cybernetician:
One more thing calculate all values of resistors RB RE RC etc for switching according to your case. 8)

You intentions and idea my be good, but without a schematic drawing of what you are trying to say, it probably won't get much chance at being implemented.

Lefty

I don't know how to add picture here but i attach a schematic. If we can turn on and off the motor then we can also do that. If there is some thing wrong please let me know.

transistor-switch (1).png

Oh, THOSE resistors. Yeah I get what you're saying. I need to figure out how to calculate those to begin with. It's just switching 5V ...

You could connect the LEDs to the USART in SPI mode:

Yes I could do that, except the library (FastSPI) used to drive them uses the native SPI port. And I have no idea how to hack it to use a different port.