Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Connecting pins 3.3V to 5V

Status
Not open for further replies.
Hello and thanks always.

I would like to ask some advice for my situation here.

The situation

I have a 3.3V microcontroller (the STM32). In fact this can be powered by 5V it seems but the pins act based on 3.3V

I plan to use a SLA (7026 or 7080s) to control a stepping motor as I did in the past using a 5V micro. I dont know if these can use 3.3V so I am thinking why not go for what I know it works , meaning 5V for this.

So the remaining situation is: I got 4 pins coming out from the controller (3.3V) that I have to connect with 4 pins of the SLA (5V). The classic 4 pins to control a stepper (A, ~A, B,~B).

The problem

So I have to connect these pins . I know there are level converters (sorry I dont remember now the model number) that I can use, and maybe I will use that since these are only 4 pins... (do anybody remember the model number??)

The question

However I saw one guy over here got a schematic with a similar problem, but the solution didn't involve these level converters, but something with transistors I believe. So my question is, given the situation described, is there a solution with transistors or other elements to connect these 4 pins??

(and also the converter model if anyone remembers)

Thanks a lot
 
Yes, cascode connected NPN transistors.

meaning:
emitter connected to microcontroller output.
base connected thru a 20k resistor to 3.3 volt
collector pulled up by a 4.7k resistor to 5 volt. output to your stepper controller at the collector-resistor junction.

Any general purpose NPN transistor will work.
 
I downloaded the datasheet for the STM32F101x4, I did not know your exact part, should be similar. In the datasheet is a table for the I/O. I think your SLA is most likely TTL compatible, according to the ST32 datasheet, (see attached table) it outputs TTL/CMOS compliant voltage levels which means you should not need any extra interface. If you can breadboard it for a test, I would try it. Bottom line, I think your good to go.

Output voltage levels
Unless otherwise specified, the parameters given in Table 35 are derived from tests
performed under the ambient temperature and VDD supply voltage conditions summarized
in Table 8. All I/Os are CMOS and TTL compliant.

STMicroVOHTable.PNG
 
Thank you very much

You are refering to something like the post in here?

https://electronics.stackexchange.com/questions/82104/single-transistor-level-up-shifter/82112#82112

(the resistor values are different though)



Yes, cascode connected NPN transistors.

meaning:
emitter connected to microcontroller output.
base connected thru a 20k resistor to 3.3 volt
collector pulled up by a 4.7k resistor to 5 volt. output to your stepper controller at the collector-resistor junction.

Any general purpose NPN transistor will work.
 
Thank you for your reply. It took me a while to understand.
I found this excelent guide
https://www.newark.com/pdfs/techarticles/microchip/3_3vto5vAnalogTipsnTricksBrchr.pdf

I guess you are referring to "Tip #5"
I am using a STM32F091 nucleo which according to this document
https://www.mouser.com/ds/2/389/DM00115237-524529.pdf

uses a VOL of 0.4V and a VOH of VDDIOx-0.4 (or 1.3?? confused) (page 82)

but I am planning to use either SLA7026 with VIN H 2.0 and VIN L 0.8
or as recommended by the manufacturer SLA7083 with VIH VDD*0.75= 3.75 and VIL= VV* 0.25= 1.25

Which means that if I use SLA7026 I am good to go 2.9>2 and 0.4 <0.8 but with SLA7083 I cant! (2.9<3.75!)

Which puts me in the problem again...





I downloaded the datasheet for the STM32F101x4, I did not know your exact part, should be similar. In the datasheet is a table for the I/O. I think your SLA is most likely TTL compatible, according to the ST32 datasheet, (see attached table) it outputs TTL/CMOS compliant voltage levels which means you should not need any extra interface. If you can breadboard it for a test, I would try it. Bottom line, I think your good to go.

Output voltage levels
Unless otherwise specified, the parameters given in Table 35 are derived from tests
performed under the ambient temperature and VDD supply voltage conditions summarized
in Table 8. All I/Os are CMOS and TTL compliant.

View attachment 97739
 
You can buy ready made level converter boards on ebay that are probably cheaper than buying the components. This is one example.
**broken link removed**
If you search for "5 v to 3.3 v level converter" on ebay you will find many sellers.
You will find the schematic of these boards here https://www.sparkfun.com/products/12009

Les.
 
In my experience there is often no need for level shifters for unidirectional I/O.
When a 3.3 volt device is driving a 5 volt device, the 3.3 volt output will usually be interpreted as a logic 1 by the 5 volt device.
When a 5 volt device is driving a 3.3 volt device you should add a resistor, about 1k, to prevent the input protection diodes from passing excess current.

Of course, bidirectional I/O is a more complicated matter.
 
In my experience there is often no need for level shifters for unidirectional I/O.
When a 3.3 volt device is driving a 5 volt device, the 3.3 volt output will usually be interpreted as a logic 1 by the 5 volt device.
When a 5 volt device is driving a 3.3 volt device you should add a resistor, about 1k, to prevent the input protection diodes from passing excess current.

Of course, bidirectional I/O is a more complicated matter.

I agree. The ST32 data sheet states the outputs are TTL and CMOS compliant. If in doubt, I would call a ST Field Apps engineer, or use their support forum. This simple phone call can save time, effort, and unnecessary components added to the design. But that is just my opinion, and ultimately it is the designers decision.
 

The question

However I saw one guy over here got a schematic with a similar problem, but the solution didn't involve these level converters, but something with transistors I believe. So my question is, given the situation described, is there a solution with transistors or other elements to connect these 4 pins??

Long weekend ahead, I needed to connect a (5V Vdd micro) to an RN42 BT module.

It took few hours for a protoboard test and to have one for 8 bits up and running in the first try.

The resulting hardware was a kludge but worked.

SANY9329.JPG
 

Attachments

  • Level converter 5V 3V3.pdf
    20.6 KB · Views: 152
Thank you very much for your reply. I will use this chance to ask a related question. I have passed too much time doing stuff without a proper knowledge. Could someone teach me of a good resource (tutorial, link etc) to learn in a clear and simple way the differences between TTL and CMOS. I have google it sometimes but somehow cant seem to understand it well yet.

Thanks


I agree. The ST32 data sheet states the outputs are TTL and CMOS compliant. If in doubt, I would call a ST Field Apps engineer, or use their support forum. This simple phone call can save time, effort, and unnecessary components added to the design. But that is just my opinion, and ultimately it is the designers decision.
 
Could someone teach me of a good resource (tutorial, link etc) to learn in a clear and simple way the differences between TTL and CMOS.

Unfortunately, it has gotten really really muddy.

In simple terms TTL means a zero logic level between 0 and x; for x>y an indeterminate level and for x>x a logic 1.
The inputs float high. The power supply is 5 V

CMOS, the switching voltages are nearly the rail voltages, so you need FETS or pull up/downs, Anything away from about a diode drop is indeterminate. CMOS MUST have it's inputs tied to either Vss or Vdd.

Now, there is everything in between. TTL compatible generally means the logic levels generally work.

Here's a place to start: https://en.wikipedia.org/wiki/Logic_family

You really didn't know the term to search on.
 
Yes, but as I understand this only happens when the VIHs VILs and VOs match, which is not always the case....

In my experience there is often no need for level shifters for unidirectional I/O.
When a 3.3 volt device is driving a 5 volt device, the 3.3 volt output will usually be interpreted as a logic 1 by the 5 volt device.
When a 5 volt device is driving a 3.3 volt device you should add a resistor, about 1k, to prevent the input protection diodes from passing excess current.

Of course, bidirectional I/O is a more complicated matter.
 
One of the things that puzzles me about TFT and CMOS is that it is rarely mentioned in datasheets (or maybe I dont read well:banghead:)
For example SLA7026M

http://www.futurebots.com/7024.pdf

and SLA7083M

http://www.semicon.sanken-ele.co.jp/sk_content/sla7081mpr_ds_en.pdf

Here, (reading again) it says that SLA7083M "operates with CMOS input" I also suspect that because VIL and VIH were VDD*0.25 and VDD*0.75

But the 7026 does not mentioned anything although it seems TTL becasue its VOH and VOL are 2.0 and 0.8....
 
The 7026 has Il and Ih, I think a bit higher than standard CMOS. e.g. the -800 uA. Contrast this with ILl and Ilh of 1 uA.

The +-1 uA is closer to a CMOS spec, but the logic levels are not CMOS. They are more like TTL compatible. This is where weird things like leakage currents come into play.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top