Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] How to connect a 3.3v USART to an 5v USART?

Status
Not open for further replies.

h.v

Junior Member level 2
Joined
May 27, 2008
Messages
22
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,281
Activity points
1,515
i need to connect a GPS operating on 3.3 v to an AVR mega32 with 5v supply via USART.
how is it possible to do that?
i think i need a level convertor!
here are my suggestions!!! are they able to do this?


GPS(3.3v) RX,TX =====>74ACT125(5v)======>MCU(5v) RX,TX
GPS(3.3v) RX,TX =====>MAX232(3.3v)=====>MAX232(5v)======>MCU(5v) RX,TX
GPS(3.3v) RX,TX =====>pull up resistor======>MCU(5v) RX,TX

i have not implement them yet! Because i am not sure if they would harm GPS or MCU!!!
 

GPS(3.3v) RX,TX =====>74ACT125(5v)======>MCU(5v) RX,TX
GPS(3.3v) RX,TX =====>MAX232(3.3v)=====>MAX232(5v)======>MCU(5v) RX,TX
GPS(3.3v) RX,TX =====>pull up resistor======>MCU(5v) RX,TX

Your suggested solutions are all in one way, from the GPS to the mcu but you have receive and transmit pins in both ways so you must apply a different solution in each direction.
Please check the following two posts
https://www.edaboard.com/threads/198179/#post832280
https://www.edaboard.com/threads/198179/#post833450

Alex
 
  • Like
Reactions: h.v

    h.v

    Points: 2
    Helpful Answer Positive Rating
Your suggested solutions are all in one way, from the GPS to the mcu but you have receive and transmit pins in both ways so you must apply a different solution in each direction.
Please check the following two posts
https://www.edaboard.com/threads/198179/#post832280
https://www.edaboard.com/threads/198179/#post833450

Alex

i meant this
GPS(3.3v) TX =====>74ACT125(5v)======>MCU(5v) RX
GPS(3.3v) RX <=====74ACT125(5v)<======MCU(5v) TX

GPS(3.3v) RX=====>MAX232(3.3v)=====>MAX232(5v)======>MCU(5v) TX
GPS(3.3v) TX<=====MAX232(3.3v)<=====MAX232(5v)<======MCU(5v) RX

---------- Post added at 21:27 ---------- Previous post was at 20:43 ----------

is possible to do that with CD4504 (Cmos Hex Voltage Level Shifter) or 74HC4050(Hex High-to-Low Level Shifter)???
 

The solution with MAX232 would be a problem because it can't work with 3.3v power supply,
there is another version for that, the MAX3232 but i think the cost of using 2 chips will be high.

I don't know about the CD4504 and 74HC4050.
One simple solution using only one chip would be to use a 74HCT244 (Octal buffer/line driver; 3-state) with a power supply of 5v,
the input translates anything above 2v as high state so the 3.3v to 5v would be fine,
in the reverse direction (using another buffer of the chip)the input would be 5v and you can use 2 resistors as voltage divider to reduce the 5v output to the level of 3v3,
for example with a 1k8 resistor connected to the output of the and a 3k3 from there to the gnd, the output between the two resistors would be 3300/(3300+1800)=0.647*5v=3.23v
the current of this divider would be about 1mA so i guess you will get about 3v in the output because of the additional voltage drop in the output of the 74HCT244.

Alex
 
  • Like
Reactions: h.v

    h.v

    Points: 2
    Helpful Answer Positive Rating
i meant this
GPS(3.3v) TX =====>74ACT125(5v)======>MCU(5v) RX
GPS(3.3v) RX <=====74ACT125(5v)<======MCU(5v) TX

GPS(3.3v) RX=====>MAX232(3.3v)=====>MAX232(5v)======>MCU(5v) TX
GPS(3.3v) TX<=====MAX232(3.3v)<=====MAX232(5v)<======MCU(5v) RX

---------- Post added at 21:27 ---------- Previous post was at 20:43 ----------


is possible to do that with CD4504 (Cmos Hex Voltage Level Shifter) or 74HC4050(Hex High-to-Low Level Shifter)???

Yes, you can but, this IC is one way direction. That's mean you have to use two of this IC.
The ones in the above link are bi-directional so, you can use only one IC.

Hope this helps.
 

transistor switch as a level shifter ...? just thinkin ... might work ...
3.3TX>>Base, 5>>Coll. Emit>>Gnd thru a resistor ... reverse it for the other pin .... should work ..
 

Attachments

  • AN3007.pdf
    171.4 KB · Views: 212
  • an97055.pdf
    75.3 KB · Views: 171
  • AN_11.pdf
    62.9 KB · Views: 176
  • pca9306.pdf
    684 KB · Views: 173
Last edited:
The Tx,Rx lines transfer data in one direction so it is more simple from the bidirectional solutions,
the transistor solution can work too but with a different configuration for each direction, the output of the circuits below can provide a limited current in the output and the output is intended for high impedance inputs.

level_converter.jpg

Alex
 
  • Like
Reactions: h.v

    h.v

    Points: 2
    Helpful Answer Positive Rating
Thanks for the replies,

I used a 74HCT125 for converting 3.3 to 5 and it works OK.
I have not connected the reverse direction yet!!
I am going to use a voltage divider for 5 to 3.3!!!

some questions in this regard!

1-“Dose a resistor divider or a transistor switch (above post) may lead to increase the USART transmission error rate? “
2-“Are they fast enough in comparison to the other solutions?”
3-may a voltage divider lead to burn the RX in GPS? Due to over current for example!!
4-which one is better:
5v MCU TX ===>resistor voltage divider===>3.3v GPS RX
5v MCU TX ===>74HCT244 ===>resistor voltage divider===>3.3v GPS RX
5v MCU TX ===>transistor ===>resistor voltage divider===>3.3v GPS RX
 

The switching speed will be about 100.000 times /sec , this can be easily managed by any transistor,
I don't think you will have problems with that.
You rate is so slow compared to the capably of either solution that it doesn't matter which one you use.
The error rate has to do more with the deviation of the proper transfer speed between the transmitter and receiver.

All 3 solution you propose would work fine.

If the voltage level has a proper value there is no way the GPS can be damaged,
and in addition there is also the resistor that limits the current (from the voltage divider).

Alex
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top