Help designing circuit to automatically disconnect chip from VCC - Page 1
Forum section: electronics / beginners

author: bhorobec
author_rank: Contributor
timestamp: October 29, 2013, 12:06:08 am
content: Hi everyone. So I am trying to design a circuit which allows me to program an Atmel microcontroller in-circuit using an ISP connector. The microcontroller should be programmable using either a 5v or 3.3v programmer. The problem is I have another chip on the same power rail as the microcontroller that is not 5V tolerant. So this needs to be disconnected from the power supplied through the ISP header, but also connected to the same power rail as the ATMEGA which operates at 3.3V under normal operation. I've come up with a simple circuit suing a P-FET and a Schottky diode which I think will work, but I am fairly new to designing circuits like this, so if anyone could let me know if this should work or not, I would appreciate it. Below is a link to my schematic:http://s23.postimg.org/wkd6z5hbv/circuit.pngThanks in advance.

author: nemo000111
author_rank: Contributor
timestamp: October 29, 2013, 02:22:06 am
content: I used a DPDT switch for this. When the switch is in program mode, the isp serial out is active and the 2nd chip is disconnected from vcc. When it's in operational mode, the isp serial out is off and the 2nd chip is connected to vcc. I needed to use a dpdt because I was using the serial pins on the chip or other communications and needed to keep the reprogramming data off the rest of the serial bus. This also let me do it with one part and no wasted power. I did put in an indicator led when it was in program mode however and the circuit wouldn't operate in program mode; so it was fairly idiot proof. Since mine was battery operated, constant current draw was important. Why does this have to be automatic? Flashing shouldn't typically be done all that much. If it is, you can still go the switch route. Design a cover over the isp header that toggles the switch when it's opened or closed.

author: bhorobec
author_rank: Contributor
timestamp: October 29, 2013, 03:54:48 am
content: Hi. A switch does seem like a good alternative. I never thought of that to be honest. I don't need to worry about switching the serial pins, since based on my testing, the other chip does not interfere with serial communications when it has no power. And all its serial pins (except MISO) can handle 5V just fine. So I guess a SPDT switch would work fine for me. However, I think I would prefer a fully automatic system if possible. It's just simpler imo and 1 less thing to have worry about. Current consumption isn't an issue since this is an always-plugged in, always-on system. But I don't see why it would consume any power in normal operation anyways, besides the small resistive drop in the FET, and of course the voltage drop in the diode (which is only present in programming mode). Is there any reason that my design shouldn't work? Thanks.

author: amyk
author_rank: Super Contributor
timestamp: October 29, 2013, 05:24:30 am
content: What's wrong with just using a 3.3V programmer?

author: codeboy2k
author_rank: Super Contributor
timestamp: October 29, 2013, 05:57:44 am
content: Quote from: nemo000111 on October 29, 2013, 02:22:06 amDamn.. If they don't make those already, they should.. or not necessarily a cover, but a shrouded header that has an extra sense line for insertion, much like the audio jacks.As for the OP's circuit, it will work fine, as long as the top of R1 is also connected to ICSPVCC. That schematic is a mess, and I can't tell. There's no dots for connections, so I can't tell if a wire crosses or connects, especially at that junction of D1, R1, Q1 gate, and drawing the Diode outline on top of the wire doesn't help either.I drew it clearer below. I think it's the same as yours but it shows the junction dots, and it's easier to read.You could also simply use a 3.3V zener on the ICSPVCC line,and just make sure you current limit it enough, but not too much to starve the MCU. Or put a 3.3V zener on the ETHV+ line and again current limit it enough so you don't overheat the zener, but providing enough current to the device still.