Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post here to teach people how to do something.

Moderators: Chuckt, Garth, bitfogav

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Chuckt
I practically live here!
I practically live here!
Posts: 1127
Joined: Sun Mar 28, 2010 1:36 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by Chuckt » Wed Sep 10, 2014 11:57 am

Mixed Voltage Systems: Interfacing 5V and 3.3V Devices
Eight methods for interfacing 5V and 3.3V devices will be described.
http://www.savagecircuits.com/content.p ... 3V-Devices

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by brad » Fri Sep 12, 2014 9:08 pm

Fantastic article Chuck. In-fact, I have a circuit right now that has both 3.3V logic and 5V logic circuits!

Garth
I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm
Contact:

Re: Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by Garth » Tue Sep 16, 2014 2:49 pm

Good article. I would add however that passive pull-up or -down resistors make for very slow transitions since the capacitance to charge up on the line is not 0. For example, with a 10K pull-up resistor and 20pF of capacitance on the line, the pull-up time constant is 200ns, which is very, very slow by digital standards. In some of the circuits, a compensating capacitor can be added; for example, in figures 1 & 2, put a 10pF across R1 [Edit: Correction: see my next post below]; in figure 3, you could put it put it across the diode if the trr of the diode isn't already long enough or its capacitance enough; and in figures 4, 7, and 8, putting it across R1 will help turn the transistor off and on faster but will not help raise the collector voltage any faster when the transistor turns off.

I show using an LM339 (quad) or LM393 (dual) comparator for voltage translation at http://wilsonminesco.com/6502primer/pot ... HI_V_LOGIC, but this is not for very high-speed logic. I've used it primarily for 5V-to-12V logic, like 5V to 4000-series which isn't very fast anyway but can go up to 15V. I've used the 4000-series stuff primarily for analog switches, the 4066, 4051, 4052, and 4053, for controlling audio circuits that use a 12V power supply.
Last edited by Garth on Thu Sep 18, 2014 5:23 am, edited 1 time in total.
http://WilsonMinesCo.com/ lots of 6502 resources

Chuckt
I practically live here!
I practically live here!
Posts: 1127
Joined: Sun Mar 28, 2010 1:36 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by Chuckt » Wed Sep 17, 2014 12:16 am

Garth,

I wouldn't have known that without an oscilloscope, some kind of test measurement equipment, doing some kind of test or hearing from you.

Thank you.

Chuck

Garth
I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm
Contact:

Re: Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by Garth » Thu Sep 18, 2014 5:22 am

I was in too big of a hurry earlier, and I goofed. With a hypothetical (but realistic) 20pF capacitive load on the 3.3V line, the capacitor across R1 (which drops only half as much voltage) should be more than that, not less. I was thinking less impedance, but that comes from more capacitance. The capacitor across R1 should be twice the 20pF load, not half; so it needs to be 40pF, not 10. Realistically, it might be hard to accurately predict or even measure the load capacitance, but you don't have to be very accurate. In this case I might put in 47pF as it's a lot more common than 39. ICs' data sheets usually specify a maximum input capacitance, not typical; and then you have to add that of the socket (if any), and of PCB traces which may be negligible.
http://WilsonMinesCo.com/ lots of 6502 resources

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by brad » Fri Sep 19, 2014 10:02 pm

Some very useful info added there Garth.

On a similar note, I had a little bit of a hard time with some analog inputs on a project I was helping a friend with. Basically we were reading the output from a voltage divider consisting of a 10M resistor and a photodiode (this circuit was repeated a number of times and then each circuit was connected to it's own analog input of a PIC micro controller.)

Long story short, the huge resistance resulted in a massive time constant so when we were scanning though each of the analog input pins, each input would have an effect on the other because the internal capacitor used in the ADC circuit did not have anywhere near enough time to discharge before measuring the net input.

So it was time to start looking at adding an opamp in-between then photodiode voltage divider and the analog input pin :)

Garth
I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm
Contact:

Re: Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by Garth » Sat Sep 20, 2014 7:26 am

Brad, is the photodiode a current device? If so, you can use the op amp to convert current to voltage, and there's no real time constant because the inverting input's voltage theoretically does not change, so the minute capacitance on the line is not getting charged and discharged. The non-inverting input goes to a voltage reference, the photodiode goes directly to the inverting input with no resistor, and you'll have a feedback resistor from the op amp's output to the inverting input. The output voltage then is the feedback resistor times the input current, negated. (I might not be telling you anything you don't already know, but maybe it'll be helpful for other readers.)
http://WilsonMinesCo.com/ lots of 6502 resources

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by brad » Wed Sep 24, 2014 8:48 pm

Thanks for the info Garth and I apologise for the late reply.

Your exactly right about the photodiode, as more light strikes the surface, the leakage current increases and vice versa. Although I had been experimenting with op-amps to fix the impedance matching problem, I actually hadn't thought of implementing it in the way that you had suggested. Which now that you mention it, your way would result in the same out come but by using less components!

Garth
I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm
Contact:

Re: Mixed Voltage Systems: Interfacing 5V and 3.3V Devices

Post by Garth » Wed Apr 24, 2019 3:04 pm

I see now the link in the head post, http://www.savagecircuits.com/content.p ... 3V-Devices, is dead. I don't remember what was in the original, but one it might have been is http://nutsvolts.texterity.com/nutsvolt ... pg=46#pg46, and another is https://www.nxp.com/files/microcontroll ... AN2433.pdf, or maybe this one: https://www.newark.com/pdfs/techarticle ... sBrchr.pdf . If there's another link to the same thing, let us know.
http://WilsonMinesCo.com/ lots of 6502 resources

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 0 guests