Arduino Forum

Using Arduino => General Electronics => Topic started by: noname2x on Aug 06, 2016, 10:31 am

Title: How to wire Logic Level Converter ?
Post by: noname2x on Aug 06, 2016, 10:31 am
Hi everybody, i am really frustrated after many days try to wire the Logic Level Converter. I bought 2 of these pieces https://www.geras-it.de/documents/image/44/441/441.jpg (https://www.geras-it.de/documents/image/44/441/441.jpg) and want to use it with the HC-SR4

I wire exactly like schematic , but it didn't work. So i try to test it with a LED. In the attachment is my test wiring with arduino

red 3.3v to a2 logic input
white 3.3V from Arduino
orange, blue is ground
green output at 5V site
yellow 5V from arduino

The LED glows very weak, the measured voltage is just about 1,0v to 1,5v . The same happens with the second piece , i have no idea why  :smiley-confuse:  . Can somebody help me please ? Thanks so much
Title: Re: How to wire Logic Level Converter ?
Post by: Riva on Aug 06, 2016, 10:52 am
What schematic are you referring to as I don't see one on the product page here (https://www.geras-it.de/arduino-kompatibel/3-3v-5v-txs0108e-8-channel-logic-level-converter-convert-ttl-bi-directional-mutual-convert/a-441/#description).

Have you also connected the OE, VA, VB & GND correctly?
Title: Re: How to wire Logic Level Converter ?
Post by: noname2x on Aug 06, 2016, 11:07 am
Thanks for reply, the schematic here http://www.artekit.eu/using-logic-level-converters/ .

VA i connected to 3.3 V from arduino, VB to 5V and same Ground for both VA an VB, OE unconnected
Title: Re: How to wire Logic Level Converter ?
Post by: TomGeorge on Aug 06, 2016, 11:30 am
Hi,
OP's images.
(https://www.geras-it.de/documents/image/44/441/441.jpg)
(http://forum.arduino.cc/index.php?action=dlattach;topic=416972.0;attach=176486)
Title: Re: How to wire Logic Level Converter ?
Post by: TomGeorge on Aug 06, 2016, 11:31 am
Hi
OP's Image
(http://www.artekit.eu/wp-content/uploads/Connections_v2.jpg)
Title: Re: How to wire Logic Level Converter ?
Post by: TomGeorge on Aug 06, 2016, 11:32 am
Hi,
Question1, the BRIGHT Led you have on the protoboard, where is the current limit resistor?
Question2, why do you need a level interface between 5V UNO and 5V HC-SR4?

http://arduinobasics.blogspot.com.au/2012/11/arduinobasics-hc-sr04-ultrasonic-sensor.html

Tom.. :)
Title: Re: How to wire Logic Level Converter ?
Post by: noname2x on Aug 06, 2016, 11:48 am
1. the LED can be drove directly from 5V (tested) , i just use it to see if the the chip output correctly
2. I actually use another linux embbeded system which has 3.3v GPIO . The point of using Arduino is to have the 3.3v and 5V output just for testing the chip
Title: Re: How to wire Logic Level Converter ?
Post by: outsider on Aug 06, 2016, 01:13 pm
If that LED hasn't melted yet, try it with a 470 - 560 R resistor in series with the LED.
Title: Re: How to wire Logic Level Converter ?
Post by: noname2x on Aug 06, 2016, 01:23 pm
But the output is still not correct .... Input is HIGH on 3.3v Site but on the 5V Site there is only 1.5V ?
Title: Re: How to wire Logic Level Converter ?
Post by: MorganS on Aug 06, 2016, 05:43 pm
...Which is the forward voltage of the LED. You won't see any higher voltage until the LED pops or you put in an appropriate resistor. Wear eye protection.
Title: Re: How to wire Logic Level Converter ?
Post by: noname2x on Aug 06, 2016, 05:49 pm
I have to remind you guys, the problem here is not about the LED ! It has nothing to do with the LED , the LED is just there to check if there is voltage there. Later if everything work correctly , i will use that setup with the Ultrasonic sensor . I am asking why my wiring not work ? and why the output is only 1,5 V at the 5V site althought i do exactly like instruction ? :( :(
Title: Re: How to wire Logic Level Converter ?
Post by: avr_fred on Aug 06, 2016, 06:11 pm
You are not listening to those that know far more about electronics than you. Yes, it has everything to to do with the LED. You asked why the LED is so dim and why is there only 1.5 volts output. Others have explained why but you have dismissed them without learning anything.

Please do as the others have suggested and place a 470 ohm resistor in series with the LED and then measure the output voltage again on the 5 volt side. You'll see that it has risen to approximately 5 volts and you should see about 3 volts across a white or blue LED. That will prove the logic level convertor is working. That is of course if you've not blown anything up...

Once you've stopped chasing the "red herring" you've created by using the LED improperly, you can get on with troubleshooting the original problem.
Title: Re: How to wire Logic Level Converter ?
Post by: noname2x on Aug 07, 2016, 02:52 am
Ok guys , i am sorry, i am just so frustrated about that problem. So this time i remove the LED , i measure the open voltage at the pin -> 0V . I try to connect pin OE to 3.3v , the output is now at 5 V . I thought it worked ... but not actually . The thing is when i put the pin on 3.3V Domain on LOW , the output on 5V domain still there. Really really confusing ! :(
Title: Re: How to wire Logic Level Converter ?
Post by: runaway_pancake on Aug 07, 2016, 03:48 am
I try to connect pin OE to 3.3v...
"OE" is pulled up to 'VCCA' already.

http://www.artekit.eu/resources/ak-txs0108-v2/doc/AK-TXS0108_V2.0-1.pdf (http://www.artekit.eu/resources/ak-txs0108-v2/doc/AK-TXS0108_V2.0-1.pdf)
Title: Re: How to wire Logic Level Converter ?
Post by: Southpark on Aug 07, 2016, 04:00 am
Thanks for reply, the schematic here http://www.artekit.eu/using-logic-level-converters/ .

VA i connected to 3.3 V from arduino, VB to 5V and same Ground for both VA an VB, OE unconnected
First of all. Have you read-up on what each of those pins (eg. 'OE') do? Or what they are?

OE is 'output enable'. All outputs are "enabled" when the pin is at a logic-high voltage. Outputs are disabled when the pin is at a logic-low voltage. So, should probably just connect the OE pin to a logic-high voltage.

In many cases, the manufacturer may have a 'default' voltage level on that pin (via an INTERNAL pullup resistor, or sometimes a pulldown resistor). Hopefully the manufacturer guide indicates it. But yep....there are some times where those idiots don't tell you this, or they don't put that information up-front for everybody to see clearly. But this is often typical of data sheets/user guides/spec sheets - where instead of telling everything as it is (clearly, with useful typical examples), they create cryptic puzzles for users to solve for themselves.

The 'A' side is the lower voltage side. The 'B' side is the higher voltage side.

Now, as for the meaning of 'outputs', I believe that would mean..... if you use say pin B2 as an input, then pin A2 would automatically become an output. And vice versa.

So, apart from seeing what happens if you tie the OE pin to a logic-high voltage, could also try putting an electrolytic capacitor (eg. 100 microFarad) between 5V arduino pin and the arduino GND pin..... which could help to cut down on supply voltage fluctuations (if any).

The same happens with the second piece , i have no idea why
That's because you didn't follow one of the golden rules of electronics..... to check on manufacturer specifications to see if the device is able to output the required amount of 'power' (voltage and current) to drive the device (ie. to drive the LED). In many cases, if this isn't checked in advance, then it can lead to undesirable results.... like damaged components, things not working, etc.



Title: Re: How to wire Logic Level Converter ?
Post by: runaway_pancake on Aug 07, 2016, 04:03 am
So, should probably just connect the OE pin to a logic-high voltage.

It is, already, "in hardware", see previous reply and link.
Title: Re: How to wire Logic Level Converter ?
Post by: TomGeorge on Aug 07, 2016, 04:11 am
Hi,
Were you at anytime running the LED off the output of the converter without a current limit resistor?

Thanks.. Tom... :)
Title: Re: How to wire Logic Level Converter ?
Post by: Southpark on Aug 07, 2016, 04:13 am
It is, already, "in hardware", see previous reply and link.

Thanks RP.... yeah, I added some extras soon-after in my post. Thanks for that.
Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 07, 2016, 12:14 pm
datasheet (http://datasheet.octopart.com/TXS0108EZXYR-Texas-Instruments-datasheet-25361057.pdf)

OP's link (http://www.artekit.eu/using-logic-level-converters/)

Quote
TXS? TXB?
The Level Converter can be found in two flavors: the TXS line, and the TXB line. The TXS line is optimized to work on open-drain outputs as I2C or 1 wire, where the lines are bidirectional, and their direction changes from one way to the other (input <-> output), and where there is a shared bus. The TXB line is optimized to work with push-pull outputs lines, as SPI or mono directional lines.  
Looks like OP has chosen the wrong  flavor.

@OP,
Post a schematic of your planned application for this converter. We need to know how you plan to use it to determine if you have chosen the correct type.

Quote
and want to use it with the HC-SR4
Quote
The TXS line is optimized to work on open-drain outputs as I2C or 1 wire, where the lines are bidirectional, and their direction changes from one way to the other (input <-> output)  
The HC-SR4 is not an I2C device. The TXS version (you bought) is the version optimized for I2C applications. The TXB version (https://www.adafruit.com/products/395) is the type optimized for monodirectional lines (such as the ones on the HC-SR4.

HC-SR4 (http://www.micropik.com/PDF/HCSR04.pdf)

I suggest you use a monodirectional level shifter like the  74LVX245 (https://www.adafruit.com/products/735)  or CD4050 because the HC-SR4 is not an open-drain device and therefore will not work well with the TXS version you bought. You do not have a bi-directional application so you do not need a bidirectional level converter. There are no bidirectional pins on the HC-SR4. Any simple monodirectional level converter will work for that device.




Title: Re: How to wire Logic Level Converter ?
Post by: luca_p on Aug 07, 2016, 02:05 pm
"OE" is pulled up to 'VCCA' already.

http://www.artekit.eu/resources/ak-txs0108-v2/doc/AK-TXS0108_V2.0-1.pdf (http://www.artekit.eu/resources/ak-txs0108-v2/doc/AK-TXS0108_V2.0-1.pdf)

I think the OP's board is not the same on the schematics you linked.

If the board the OP is using is this (https://www.geras-it.de/arduino-kompatibel/3-3v-5v-txs0108e-8-channel-logic-level-converter-convert-ttl-bi-directional-mutual-convert/a-441/#description) I can only see two decoupling caps. So the OP should be connecting OE to VA.
Title: Re: How to wire Logic Level Converter ?
Post by: noname2x on Aug 07, 2016, 02:48 pm
Hey southpark, Thanks for your very nice explanation . I now remove the LED , unconnected OE , try with a capacitor like you said. I measure 5V at the output . Problem solved !!

Thanks you guys so much !!!
Title: Re: How to wire Logic Level Converter ?
Post by: noname2x on Aug 07, 2016, 02:53 pm
@ raschemmel  yeah i think it's could be the problem with the wrong version too, i will order another version and give i try. Thanks !
Title: Re: How to wire Logic Level Converter ?
Post by: Southpark on Aug 07, 2016, 03:49 pm
Problem solved !!

Thanks you guys so much !!!
Great to see and hear you're back in action!
Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 07, 2016, 05:37 pm
Quote
@ raschemmel  yeah i think it's could be the problem with the wrong version too, i will order another version and give i try. Thanks !
Please read what I said.
You do NOT need a bidirectional level converter. Any mono-directional level convert will suffice.

Quote
I think the OP's board is not the same on the schematics you linked.

If the board the OP is using is this I can only see two decoupling caps. So the OP should be connecting OE to VA.
This is the link the OP posted in Reply#2 . You are correct that it does not match the link posted in the OP (Reply#0) . The schematic for that link was posted in Reply#13. We do not (as you have implied),
actually know which one the OP has since he has linked both. Regardless of which link, it seems clear that since both links are for an XTS type, both schematics are for the WRONG type of level converter, rendering the schematic issue irrelevant. The OP is NOT using I2C and therefore should NOT use the XTS, but COULD use the XTB , IF he had a bidirectional application, which he does NOT. Therefore,
neither the XTS nor the XTB are what he needs but if he HAD to choose between those two, the correct choice would be the XTB.  What he SHOULD be using is a simple monodirectional level converter like the ones linked (https://www.adafruit.com/product/735) in my previous post.

Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 08, 2016, 07:34 am
Hello there,


I just thought i would add a small note here about a particular caution when using *some* logic level converters.


Most logic level converters require a 3.3v voltage source input when going from 5v to 3.3v which is very common, although this note applies to any voltage lower than 5v like 1.8v also.

The important point is that logic level converters require a clamp to the +3.3v line, and during operation if this line becomes disconnected for even a microsecond, that could cause the input of the 3.3v device to get a voltage high enough to blow out one of the input protection diodes which then could cause the whole 3.3v device to malfunction.
In other words, if the 3.3v line becomes disconnected the 3.3v device blows out.

The reason i bring this up is because we often use those little jumpers for connecting the Arduino to other devices, and that means we have to rely on the connection of the jumper to the headers.  This works fine in many applications because if it becomes disconnected we just plug it back in or jiggle it a little and it works again.
But with a clamp voltage we cant get away with that.  The clamp voltage must be present for the entire time the circuit is running or else something blows out.

The only fix is probably to SOLDER that particular wire in place, on both the Arduino (perhaps under the board) and the 3.3v device.  That makes it more permanent.  Of course steps should be taken to make sure the wire cant break either.

Good luck with it.
Title: Re: How to wire Logic Level Converter ?
Post by: MorganS on Aug 08, 2016, 08:06 am
I don't understand the failure mode. How does having a 3.3v "clamp" stop damaging amps from flowing from the 5V side? Those amps aren't going into the 3.3V rail because then it would simply fail to be a level converter - it could not have worked in the first place.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 08, 2016, 08:33 am
I don't understand the failure mode. How does having a 3.3v "clamp" stop damaging amps from flowing from the 5V side? Those amps aren't going into the 3.3V rail because then it would simply fail to be a level converter - it could not have worked in the first place.
Hi,


We could take a look at the particular logic level converter you are talking about if you post a picture of the schematic.  I suppose some could be different.
The ones that rely on a clamp diode to +3.3v would be the ones affected.


Title: Re: How to wire Logic Level Converter ?
Post by: Southpark on Aug 08, 2016, 09:11 am
Most logic level converters require a 3.3v voltage source input when going from 5v to 3.3v
Hello....... do you mean 'going from 3.3V to 5V'?
Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 08, 2016, 09:46 am
Quote
We could take a look at the particular logic level converter you are talking about if you post a picture of the schematic.  I suppose some could be different.
The ones that rely on a clamp diode to +3.3v would be the ones affected.
Well I don't know what all the fuss is about. I never had a problem with one of these. (https://cdn-shop.adafruit.com/product-files/1787/1787AHC125.pdf)

or

these (https://www.fairchildsemi.com/datasheets/CD/CD4049UBC.pdf)

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.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 08, 2016, 10:57 am
Hello....... do you mean 'going from 3.3V to 5V'?
Hi,

Well, whenever a 5v system has to talk to a 3.3v system bidirectionally or even when a 5v system has to talk to a 3.3v system.
The signal starts out as a 0 to 5v level, either about 0v or about 5v.  That has to go to the input of the 3.3v device somehow, so we use a logic converter sometimes.

One scheme for example is to use a resistor in series with the 3.3v input, and clamp the 3.3v input to either +3.3v or a little lower than that so the diode drop doesnt change much.  If that +3.3v power line becomes disconnected, the 3.3v input sees the whole 5v signal which causes the upper ESD diode to conduct which blows the chip.

I realize other types of logic level converters may not have this problem if the +3.3v power line becomes disconnected because the MOSFET says 'off'.

We could look at specific drawings if someone wants to look at one they had been thinking about.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 08, 2016, 10:58 am
Well I don't know what all the fuss is about. I never had a problem with one of these. (https://cdn-shop.adafruit.com/product-files/1787/1787AHC125.pdf)

or

these (https://www.fairchildsemi.com/datasheets/CD/CD4049UBC.pdf)

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.
Title: Re: How to wire Logic Level Converter ?
Post by: MorganS on Aug 08, 2016, 05:49 pm
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.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 08, 2016, 06:40 pm
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 :-)
Title: Re: How to wire Logic Level Converter ?
Post by: MorganS on Aug 08, 2016, 10:37 pm
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.
Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 08, 2016, 11:14 pm
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.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 09, 2016, 07:27 am
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.


Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 09, 2016, 09:17 am
Atmel AVR182, very top of page 4.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 09, 2016, 11:32 am
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.
Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 09, 2016, 11:47 am
I would think so but that's just a guess.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 09, 2016, 01:40 pm
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.
Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 09, 2016, 03:06 pm
reread the Atmel AVR182/page-4 comment. (http://www.atmel.com/images/doc2508.pdf) 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. 
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 09, 2016, 05:10 pm
reread the Atmel AVR182/page-4 comment. (http://www.atmel.com/images/doc2508.pdf) It mentions a 1 Mohm resistor.

Hi,

Surely you dont think we can use a 1Meg resistor for everything.
Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 09, 2016, 05:36 pm
Ask Atmel. I didn't write the document.
Title: Re: How to wire Logic Level Converter ?
Post by: dlloyd on Aug 09, 2016, 07:24 pm
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 (http://www.atmel.com/images/doc1619.pdf).
Title: Re: How to wire Logic Level Converter ?
Post by: MorganS on Aug 09, 2016, 09:14 pm
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?
Title: Re: How to wire Logic Level Converter ?
Post by: dlloyd on Aug 09, 2016, 10:58 pm
Yes, your right ... for some reason I thought conduction would begin at around Vcc +0.3V like with the Due. Nope. With 12.0V at Vin and using 10K I measured 5.54V at a digital input. This is only about 650µA through the internal protection. Wow, looks like 1mA might be pushing it!
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 10, 2016, 10:03 am
Ask Atmel. I didn't write the document.
Hello again,

You sure?  I could have sworn i had seen at the end of the document, "I, Raschemmel, wrote this entire document".  :-)

Ok all kidding aside, i was just wondering why you told me to re-read the data sheet, that's all really.

But you've been very helpful with the information you did supply so far, so thanks for that.

Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 10, 2016, 10:09 am
I meant the circuit shows a 1 Mohm current limiting resistor and I believe it says that the resistor limits the current to 1 mA.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 10, 2016, 10:14 am
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 (http://www.atmel.com/images/doc1619.pdf).
Hi,

Yes but as i am sure you know it is a very poor way to specify the CURRENT from knowing the VOLTAGE, which is essentially the voltage across the diode itself.

For example, we can probably measure close to 3.6v with 100ua through the diode, or very close to that.  So say we measure 3.55v at 50ua.  Do we stop there or push it?  So say we measure 3.59v at 100ua, do we stop there or push it a little higher.  Or maybe it's 200ua, but at some point we have to call the voltage 3.600000v even though a meter is not perfect.  This could lead to several people measuring the same spec differently.
The real point being that a spec for the CURRENT should be a spec for the current, not for the indirect current via a voltage measurement.  It's a cop out on Atmel's part.
For the AVR line they do spec 1ma max in that data sheet however, which is quite low if you ask me for a pin that can source or sink 40ma.
If we look at the Microchip line we see a spec of 20ma on chips like the 12F675 for example.  THAT is a decent current level spec to work with.
1ma means that if we expect an over voltage on an analog pin of only 2v we need a 2k resistor in series with the pin.
Title: Re: How to wire Logic Level Converter ?
Post by: MrAl on Aug 10, 2016, 10:17 am
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?
Hi,

That has been my gripe every since i started working with the ARM chip.  But i guess that mystery applies to the AVR series too then although it looks like they are sort of specifying it in that app note that quotes 1ma max for the AVR.  That's a poor way to specify it too, in an app note, when it should be right on the DATA SHEET.
How hard could it be to add it?
I think they are afraid to add it because then future designers can quickly see how poor the spec is to begin with :-)


Title: Re: How to wire Logic Level Converter ?
Post by: raschemmel on Aug 10, 2016, 10:18 am
What can I say ? ("use protection")