Go Down

Topic: How to wire Logic Level Converter ? (Read 5414 times) previous topic - next topic

MrAl

Well I don't know what all the fuss is about. I never had a problem with one of these.

or

these

They both work the same way. The output voltage is determined by the Vcc. (3.3V or 5V).
The device is 5V tolerant when running on 3.3V.

Therefore, if you THINK about it, you CANNOT use the SAME chip to go BOTH ways.
If you have some signals that need to go from 3.3V to 5V, you need one chip dedicated to that purpose. If you have OTHER signals that need to go from 5v to 3.3V you need ANOTHER chip didicated to that purpose. In the case of the OP's application, IF he had purchased the XTB instead of the XTS,
he could use the SAME chip because it is BIDIRECTIONAL. I stated that he does NOT have a BIDIRECTIONAL application because he does NOT in point of fact, have a single signal that must go BOTH directions. All of the signals in his circuit are either 3.3V to 5V OR 5V to 3.3V. That makes it a MONODIRECTIONAL application. That being said, there is ,in fact some convenience in being able to accomplish both directions with ONE chip, even if NONE of the signals are going BOTH ways.
The XTB should be capable of doing this because it has TWO supply voltage inputs and it is bidirectional so signals can go either way. It is , however NOT necessary , for the reasons given, and offers only the convenience I described in the case of the OP's application. I happen to have the XTB and NOT the XTS but have had issues with insufficient bias current to change the direction of the signal so I rely on something foolproof like the two chips linked above . These have never failed to perform the required function.
Hello there,

Some of the converters i had seen have MOSFETs for converting from one to the other level.  I believe the MOSFET stays off if the +3.3v line becomes disconnected, so maybe that's ok then.

MorganS

Umm, no? If the clamp diode is missing in the simple resistor-diode circuit, then the protection diode performs the same function. The resistor is still there so the full 5V is never presented to the protection diode.

Unless the resistor is some stupidly low value then this would never endanger the protection diode. If it is stupid, then I maintain that it would not have worked in the first place.
"The problem is in the code you didn't post."

MrAl

Umm, no? If the clamp diode is missing in the simple resistor-diode circuit, then the protection diode performs the same function. The resistor is still there so the full 5V is never presented to the protection diode.

Unless the resistor is some stupidly low value then this would never endanger the protection diode. If it is stupid, then I maintain that it would not have worked in the first place.
Hello,

Then ask yourself why anyone would have to use a clamp diode if the internal diode does the same thing.  With the clamp diode we can go up to 20ma easy, but the internal diode has no actual spec.

But you can do it any way you want to :-)

MorganS

Because a clamp diode converter is not a very good idea to begin with. It's just flushing bandwidth and reliability down the toilet. Not to mention the fact that it can draw the 3.3V rail up until those extra amps are flowing through your sensitive chip anyway.
"The problem is in the code you didn't post."

raschemmel

Quote
but the internal diode has no actual spec.
 
I can't speak for the internal diode in a logic level converter but Atmel recommends not exceeding 1 mA through the ATmega328 internal diodes. I understand that removing power to the chip with voltage on an input pin is the same as doing that with an UNO which causes BACKFEEDING through the internal diodes.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

MrAl

#35
Aug 09, 2016, 07:27 am Last Edit: Aug 09, 2016, 07:30 am by MrAl
I can't speak for the internal diode in a logic level converter but Atmel recommends not exceeding 1 mA through the ATmega328 internal diodes. I understand that removing power to the chip with voltage on an input pin is the same as doing that with an UNO which causes BACKFEEDING through the internal diodes.
Hi there Raschemmel,

That's very good to know, thanks for that.

Can i ask though, where did you get that 1ma spec from?
I ask because i contacted Atmel and did not get a spec for that diode.  They said something to the effect that they dont specify that.
But if you found it on a data sheet or app note or something i'd like to see that very much.

With Microchip they specify 20ma max on the upper and lower diodes.  I have always found that spec very useful.

Note this also comes in handy when trying to specify the max voltage for use on an ADC pin like for the Due but even the Uno really.  That's not a logic level converter thing, but we still need to know what we can do with the ADC pins.



raschemmel

Atmel AVR182, very top of page 4.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

MrAl

Atmel AVR182, very top of page 4.
Hi there,


Very good thanks.  Would you happen to know if this is the same with the ARM chips like in the Due board?  That's actually what i asked Atmel about.

raschemmel

I would think so but that's just a guess.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

MrAl

Hi,

Yeah, should be able to take 1ma right?  I would hope so :-)
If not, that would be bad.

I asked all around high and low and Atmel too, with no direct answer.
The only thing i found that 'hints' at the spec is the pin current spec, which is 3ma for some pins, but i assumed that was for the drive or sink current which may not be the same as the clamping current rating.

Let's see now...
With 5v external and R ohm resistor, clamped to 3.3v with a 0.3v drop, that's:
I=(5-3.6)/R
I=1.4/R

so:
With R=100 we get 14ma, way over 1ma.
With R=1000 we get 1.4ma, still over 1ma spec.
With R=1400 we get 1ma, which meets the spec.

So we would need a 1400 ohm resistor in series with the external 5v system device to meet the spec.

See what i mean?

Also, if the 3.3v system drops the 3.3v power supply for any reason, the current could rise to:
(5-0)/1400=3.6ma

as the external device tries to power the circuit, so we're over spec again unless we get lucky and the 5v device cant power the entire current.  3.6ma isnt much though for a 5v device.

Now i just wonder how much current a device like a 1602 LCD can supply back through the I2C data pin for example.

raschemmel

#40
Aug 09, 2016, 03:06 pm Last Edit: Aug 09, 2016, 03:07 pm by raschemmel
reread the Atmel AVR182/page-4 comment. It mentions a 1 Mohm resistor.
Quote
The series input resistor is a 1 MΩ resistor. It is not recommended that the clamping
diodes are conducting more than maximum 1 mA and 1 MΩ will then allow a maximum
voltage of approximately 1,000V. 
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

MrAl

reread the Atmel AVR182/page-4 comment. It mentions a 1 Mohm resistor.

Hi,

Surely you dont think we can use a 1Meg resistor for everything.

raschemmel

Ask Atmel. I didn't write the document.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

dlloyd

The maximum current through an I/O pin's protection diode is specified in a bass ackwards way. Basically it can handle any current that doesn't cause the pin's voltage to exceed maximum ratings. Could be tested ... I suspect significantly higher than 1mA (2-3mA??) would still be fine.

See 4.9.1 General I/O Pin Protection here.

MorganS

But isn't the maximum pin voltage just one diode-drop away from the supply voltage? Thereby limiting the current to "none at all" or some complex calculation based on the exact I-V curve of these curiously-unspecified diodes?
"The problem is in the code you didn't post."

Go Up