Author Topic: Help designing circuit to automatically disconnect chip from VCC  (Read 3061 times)

0 Members and 1 Guest are viewing this topic.

Offline bhorobecTopic starter

  • Contributor
  • Posts: 11
  • Country: ca
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.png

Thanks in advance.
 

Offline nemo000111

  • Contributor
  • Posts: 23
Re: Help designing circuit to automatically disconnect chip from VCC
« Reply #1 on: October 29, 2013, 02:22:06 am »
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.
« Last Edit: October 29, 2013, 02:24:57 am by nemo000111 »
 

Offline bhorobecTopic starter

  • Contributor
  • Posts: 11
  • Country: ca
Re: Help designing circuit to automatically disconnect chip from VCC
« Reply #2 on: October 29, 2013, 03:54:48 am »
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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 9164
Re: Help designing circuit to automatically disconnect chip from VCC
« Reply #3 on: October 29, 2013, 05:24:30 am »
What's wrong with just using a 3.3V programmer?
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: Help designing circuit to automatically disconnect chip from VCC
« Reply #4 on: October 29, 2013, 05:57:44 am »
Design a cover over the isp header that toggles the switch when it's opened or closed.

Damn.. 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.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf