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?
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.
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.
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 ..
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.
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).