6
\$\begingroup\$

I have been investigating ways to safely receive 5v signal on the input pin that can only support 3.3v input signal. I came across an article that states that it's possible to only use a single 10k Ohm resistor to achieve that. I can understand how this can prevent too much current from flowing through the schottky diode, but I am still skeptical this resistor would produce the necessary voltage drop for the signal that goes further into the MCU since the resistance of the resistor that is placed after diodes is much higher than 10k.

Will the 10k resistor work for this purpose and if so, what voltage drop would it produce?

Thanks a lot.

\$\endgroup\$
7
\$\begingroup\$

If you are serious about building reliable designs with todays high density chips you should never place a voltage on a pin that exceeds the range specified in the maximum ratings section of the manufacturers data sheet.

People who promote low cost shortcuts, such as the unitary 10K resistor resistor to isolate a 3.3V input from a 5V source, are not serious about building reliable electronics that can last for a long time unless they are are using an device that has documented 5V tolerance on its I/O pins.

There are a multitude of different chips designed with either 5V tolerant inputs or designed to properly level translate from 5V down to 3.3V. Use one of those, or if you want something cheaper that comes with a lower bandwidth, then you can utilize two resistors at each input as a voltage divider to step the 5V down to 3.3V.

\$\endgroup\$
4
  • \$\begingroup\$ I will stay away from using a single resistor and use a voltage divider instead, but I am still interested how this would work in theory. I guess I am just trying to get some information about how schottky clamping really works. To me it seems that the diode just takes away some current, but the voltage at the point after the diode (that goes further into the MCU) would still be near 5v. I am clearly missing some piece of theory here. \$\endgroup\$ – EGDima Apr 17 '14 at 2:23
  • 1
    \$\begingroup\$ The protection networks on-chip don't use Schottky diodes, though you can use a resistor in conjunction with an external Schottky diode as another option (with some advantages and disadvantages). Here's what's on-chip, at least for some chips: fairchildsemi.com/an/AN/AN-248.pdf My understanding is that the protection networks are not well (publicly) documented, as the good ones are kind of a trade secret for achieving high ESD immunity performance. \$\endgroup\$ – Spehro Pefhany Apr 17 '14 at 2:27
  • \$\begingroup\$ @EGDima yes the diodes shunt the current to VCC, and you need a load on VCC that draws more current than that to avoid the voltage rising too much. See my answer... \$\endgroup\$ – bobflux Sep 6 '17 at 15:49
  • \$\begingroup\$ I cannot believe that some person comes by today and down votes this answer. One problem that can be a serious one with only a single series resistor from a higher voltage to an input is that the on chip protection diodes can lead to on chip latchup occurring during the power transition events and lead to destructive chip damage. \$\endgroup\$ – Michael Karas Jan 23 at 0:24
4
\$\begingroup\$

This can work if the microcontroller has the same protection diodes that are shown in the article. In fact, Microchip put out an app note a few years ago that demonstrated sensing the phase of your 120V mains by connecting the 120VAC to the PIC pin via a resistor! It was an X10 communications application...

However, using the internal protection diodes in this way is kind of sketchy. It also limits any future design changes, for example, if you want to swap out the microcontroller.

If you are only receiving data on this pin, and not transmitting, it is a great application for a voltage divider. You can choose fairly large resistors to minimize wasted power...

Good luck!

\$\endgroup\$
2
  • 1
    \$\begingroup\$ It's worse than that. Process changes (how the chip is made) often result in lower input currents, smaller protection diodes, and the like. So even the "same" part may no longer work after they've "improved" it. \$\endgroup\$ – gbarry Apr 17 '14 at 1:54
  • 1
    \$\begingroup\$ I once had a die shrink cause havock because the design relied on internal pullups that went from 20-30k ohms to 300k+ ohms or similar. Turned out the transistors it was driving had a a large hfe range. Adding 10k pullus worked and the board had to be respun :( \$\endgroup\$ – Spoon Apr 17 '14 at 12:43
1
\$\begingroup\$

Yes... and no...

(5V - 3.3V)/10k = 170µA

The current will flow through the protection diodes. If the micro is in deep sleep, or possibly even in reset, it will consume less than that. If there are no other loads to use this current, the 3V3 supply voltage will rise to a value close to 5V. At this point if the micro is a 3.3V part, it will die, other 3V3 parts on the same rail might also die...

It can also latch-up, or bust an ESD diode, etc, as explained in the other answers.

If you're not saving µA then a voltage divider will work fine, but be aware that the extra resistance will slow things down when interacting with the pin's capacitance, so don't do this on a 10MHz signal! It's okay for slow stuff though.

If this is battery-powered and you want to save µAmps, or you need the speed, a 74LVC logic gate is a good choice, when powered from 3V3 its inputs are 5V tolerant and it will consume very low static power while being very fast.

Also you might be able to hack the source of the signal. If it's an open drain/open collector output, simply put the pullup from 3V3 instead of 5V, problem fixed.

\$\endgroup\$
2
  • \$\begingroup\$ To avoid that the 3.3V rail increases, one could put a dummy load resistor between 3.3V and ground. But you will waste power... \$\endgroup\$ – next-hack Sep 6 '17 at 16:02
  • \$\begingroup\$ This is an excellent and concise explanation of how things can go wrong. Although it's kind of mind-boggling to imagine 170µA resulting in a significant voltage rise, I guess that could happen... \$\endgroup\$ – Sod Almighty Feb 8 at 1:49
0
\$\begingroup\$

I will give you a very easy solution.

Add one more resistor connected to the ground, which will draw MOST of the current that you are worrying about to the ground. Of course, the value of the resistor should be a lot less than the input impedance of your port pin.

In other words, use the two resistors as resistive voltage divider which steps down 5V to 3.3V. then connect the point where the two resistor meets to MCU's GPIO.

\$\endgroup\$
3
  • \$\begingroup\$ Isn't that a voltage divider? \$\endgroup\$ – EGDima Apr 17 '14 at 21:48
  • 1
    \$\begingroup\$ It is a voltage divider and is one and same as has already been suggested \$\endgroup\$ – Michael Karas Apr 18 '14 at 1:39
  • 1
    \$\begingroup\$ @EGDma Yes It is just a voltage divider and it works perfectly. I have tried it in my design for interfacing 3.3V MCU with 5V RS-485 transceiver. \$\endgroup\$ – Steve Apr 18 '14 at 2:15
0
\$\begingroup\$

Use a 10K resistor from the output of the 5v chip to the input of the 3.3 volt chip. Then connect 3.3volt zener diode for across the input of the 3.3 volt chip. Anode to ground and cathode to the 3.3 volt input. Effectively you made a voltage regulator. The input of the 3.3 volt chip will never exceed 3.3 volts so it will be completely safe to run in that mode. You should be fine going the other way, a 5 volt input should read a high state at 3.3 volts.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.