Go Down

Topic: 1.8v to 5v logic level converter *solved* (Read 6183 times) previous topic - next topic

schmidtbag

Apr 16, 2013, 02:31 am Last Edit: Apr 22, 2013, 03:55 am by schmidtbag Reason: 1
I have an ARM platform with a 1.8v UART and I want to connect my Arduino to it, but I'm afraid of ruining it.  I heard about using logic level converters but surprisingly many of the sources recommending this don't have a particular model to recommend, and I can't find any that work at a 1.8v to 5v range.

I'm open to using transistors and resistors to get the job done (I have a resistor that'll do the trick) but I can't figure out how to use a transistor to amplify the 1.8v TX signal to 5v.  I know how to use a transistor for something that has an input pin and an output/ground, but I don't know how to use one for something that's basically a direct shot, and I'm afraid of ruining something.

I'm sure this is a stupid question to ask but after an hour or two of searching I can't seem to get a complete answer anywhere.

be80be

Try one of these http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm
This one TTL-232RG-VREG1V8-WE

CrossRoads

How about TXB0102?

http://www.ti.com/product/txb0102
1.8V Vcc on one side, 5V on the other.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

schmidtbag

I'm looking to avoid USB, so the TTL-232RG-VREG1V8-WE won't work for me.  The TXB0102 looks nice but is there a breakout board or a DIP version of it?  Also, while I didn't read it very thoroughly, it the datasheet doesn't explicitly say whether you can do 1.8v to 5v.  I get the impression that many of these logic converters work in increments (so for example 1.8 to 3.3, then 3.3 to 5) but like I said in my OP, I can't seem to get a complete, definite answer.  Also, are the data pins bi-directional?

CrossRoads

"This allows for universal low-voltage bidirectional translation between any of the 1.2-V, 1.5-V, 1.8-V, 2.5-V, 3.3-V, and 5-V voltage nodes."

"The TXB0102 architecture (see Figure 2) does not require a direction-control signal to control the direction of
data flow from A to B or from B to A."

You can get a breakout board for any part. Check dipmicro.com, e-bay, whatever your favorite source is.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

olof_n

Hi!

I had a similar question a couple of days ago how to convert a 2.65v signal to 5v with transistors.
I ended up using 2*NPN transistors and it worked fine (serial communication)


lemming

Breakout board for TXB0108.

https://www.adafruit.com/products/395

schmidtbag


Hi!

I had a similar question a couple of days ago how to convert a 2.65v signal to 5v with transistors.
I ended up using 2*NPN transistors and it worked fine (serial communication)




Hmm interesting.  I'm going to have to try that before I buy anything TXB010* related.

Just wondering though, but why is R6 necessary?  Why not simply just use R5 and increase the ohms?


@lemming
I saw that later last night and might consider it.  It's a little overkill but at least I don't have to worry about making a mistake.

olof_n

Hi!

R5 and R6 are a voltage divider.
In this case the output voltage is 3.33V if the input is 5V.

Vout = (R6 / R5 + R6) * VIN

3.33 = (2 / (1+2)) * 5

MarkT



Just wondering though, but why is R6 necessary?  Why not simply just use R5 and increase the ohms?



To make it switch fast - the divider circuit has a significantly lower impedance than just a high-value
series resistor - the 2k + 2k divider has an impedance of 1k, whereas using a 10k series resistor
would be 10k.  Every input has a few pF of input capacitance and the lower source impedance will drive
that capacitance faster, might make the difference between a 20MHz top frequency and 5MHz,
something like that.
[ I won't respond to messages, use the forum please ]

schmidtbag

#10
Apr 21, 2013, 06:05 pm Last Edit: Apr 21, 2013, 06:43 pm by schmidtbag Reason: 1
Thanks for the replies everyone, and sorry about the late reply - I haven't had much time to work on this until now.

The unidirectional output diagram olof_n showed seems to work fine but it revolves around a 3.3v source - mine is 1.8v.  The transistor I'm using is the 2222A.  What do I need to change to make it accept the 1.8v source?  I tried removing the resistor between the odroid TX and the T1 base, but it didn't seem to make a difference.


The receiving end works fine, I just used 1.1k and 2.2k resistors instead of the 1k and 2k, I switched their positions, and now I seem to get approximately 1.8v.  I have an analog multimeter so I'm not sure how far off from 1.8 I really am but the odroid didn't blow up *knock on wood* and it's receiving data.

Runaway Pancake


The unidirectional output diagram olof_n showed seems to work fine but it revolves around a 3.3v source - mine is 1.8v.  The transistor I'm using is the 2222A.  What do I need to change to make it accept the 1.8v source?

No "1.8V" modifications necessary (exc., perhaps a somewhat lower value for R1?)
I don't see R3 as necessary, T2_B could go directly to junction of T1_C & R2.
I'd consider adding a pulldown on the input (with a >= 22K from T1_B to Gnd.)


I tried removing the resistor between the odroid TX and the T1 base, but it didn't seem to make a difference.

So, I guess you tried that out and "no joy".  Perhaps a wiring error? 
Don't remove resistors recklessly.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

schmidtbag

I added a 27K from T1_B to gnd and it seemed to make the problem worse.  Before, simply nothing was happening, but now on odroid when I run "cat /dev/zero > /dev/ttySAC1", it claims there's an I/O error and stops.  However, it doesn't fail if I unplug the wire at T2_C.

I quadruple checked everything.  Like I said, it seems to work but only if the voltage is high enough.  If I try putting the 3.3v source from the arduino at the T1_B and then use the multimeter to check T2_C, the output is about 5v.  As a side note, when doing that (in the current setup), I've noticed T1_B is only getting about 1.5v.  Seems like a lot of resistance over there.

Runaway Pancake

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

schmidtbag

#14
Apr 21, 2013, 11:25 pm Last Edit: Apr 21, 2013, 11:58 pm by schmidtbag Reason: 1
Yes, that is how I have it set up.  But the picture you supplied confuses me a little.  T1 and T2 are NPN, but the transistor you showed me in the picture is, if I'm not mistaken, PNP:
http://3.bp.blogspot.com/-iTo2cABnytE/UAmCx3gD34I/AAAAAAAAFBc/_xjB__ClEuI/s1600/NPNvsPNP.png

Go Up