Turning on and off an ICSP circuit with a switch?

Hi,

I would like to have an Arduino, connected to a stand alone ATmega chip, let's say an ATmega328. My goal is to be able, using a simple on/off switch, to be able to connect the two appropriately (and in particular their ICSP pins) only when it is necessary. So, when the switch is ON, the ICSP pins are connected and I can program the ATmega328 from the Arduino. When the switch is off, that is not possible and those pins can be utilized otherwise.

The way I have thought of doing this, is with a transistor array (i.e. ULN2803) and an inverted.
So a connection would go something like this:
Arduino pin -> Inverter -> Transistor -> ATmega328 pin

The switch will be removing the ground of the transistors (or the inverter), therefore cutting the connection between the two.
Also, I believe the inverter should be necessary, as I will end up with an opposite/inverted signal on the Atmega pin, than the one originating from the Arduino. Of course there will be a pull up or pull down (depending on what is the IDLE state of the ICSP pins) between the transistor and the ATmega pin.

Therefore, I have two questions:

  1. Will this work?
  2. Is there a better (e.g. cheaper or less components/space) of doing this?

Thanks in advance! :slight_smile:

Use a simple switch in the signal lines.
http://www.digikey.com/product-detail/en/74HC4066D,652/568-3964-5-ND/763546
http://www.digikey.com/product-detail/en/ADG3245BRUZ/ADG3245BRUZ-ND/997490

Yeap, that is exactly what I needed but was unaware of its existence as an IC! :stuck_out_tongue:

The 74HC4066 which is in a DIP-14 package will do the trick! Thanks very much! :slight_smile: :smiley:

Glad to help.