0

5V and/or 3.3V and logic levels with 128x32 I2C Display
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

5V and/or 3.3V and logic levels with 128x32 I2C Display

by aclassifier on Sun Jun 21, 2015 4:37 pm

According to https://learn.adafruit.com/monochrome-o ... 2c-display I should connect only to 5V and leave 3.3 V not connected when interfacing with Arduino. I assume it's 5V power and logic.

However, I interface with an XMOS StartKIT at 3.3V logic. Do I then need to connect the 3.3V in addition? StartKIT has both 3.3V and 5V available for external units.

According to https://www.adafruit.com/product/757 and http://www.adafruit.com/datasheets/AN10441.pdf I think I should, since it sounds like these level shifters are the ones that are built into product 931.

I have scoped on the signals and found that I really needed pull-ups to 3.3V, but that was before I realised that the 3.3V has no connection. The scope pictures are here: http://www.teigfam.net/oyvind/home/tech ... tes/#06.01

If I need to connect both I assume power to the LEDS is from 5V and 3.3V is really only for logic level reference for the shifting logic?

If the answer is to connect to both for my case, where is this in the Adafruit docs? If not, does it need to have this explicitly said?

Øyvind Teig, Trondheim, Norway

aclassifier
 
Posts: 17
Joined: Sun Jun 21, 2015 2:03 am

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by adafruit_support_mike on Sun Jun 21, 2015 10:48 pm

If you have a microcontroller that works at 3.3v, you can connect 3.3v power and data to the display. You don't need to use 5v at all.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by aclassifier on Mon Jun 22, 2015 2:18 am

Thanks! I have both 5 and 3.3V. Logic is the latter but most power at 5. Both could be single supplier alone, but I'd like to use them shared. In that case, should the 3.3 also be connected?

Where's the circuit diagram?

aclassifier
 
Posts: 17
Joined: Sun Jun 21, 2015 2:03 am

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by adafruit_support_mike on Mon Jun 22, 2015 9:30 pm

If you'd prefer to use 5v power, go ahead. Don't connect both 5v and 3.3v though. Just use the one you like best.

The design files are over in our Github repo:

https://github.com/adafruit/Adafruit-12 ... eakout-PCB
https://github.com/adafruit/Adafruit-12 ... -board-PCB

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by aclassifier on Tue Jun 23, 2015 4:52 pm

Thanks! I have measured on the SDA and SCL lines between the display and the XMOS startKIT. There are five oscilloscope pictures at [1].

I have some comments:

[list=]
[*]The 931 web page says that "Built into the OLED driver is a simple switch-cap charge pump that turns 3.3v-5v into a high voltage drive for the OLEDs, making it one of the easiest ways to get an OLED into your project!". I can't see that this is accurate. The RT9193 regulator takes 5V to 3.3V. The display part takes 3.3V only.
[*]I can not see that not connecting 5V is according to the "AN10441 Level shifting techniques in I2C-bus design" application note. Not also connecting 5V leaves a 10+10K between a floating middle point between SDA_5.0V and SCL_5.0V since the 3.3V SDA and SCL lines are internal only.
[*]All the scope pictures at [1] work! So the display is very patient! But the 101_fig6_b and 101_fig6_c lift the lines to 5V, which is out of the startKIT's XS1-U16A-128-FB217 8-core spec. But it doesn't seem to kill it for the short time I tried. 101_fig6_a and 101_fig6_d takes the voltage to 3.3V + some hundred mV, which is ok. But it's only 101_fig6_e that works within the lines' allowed 3.3V with only 3.3V and pull-up to 3.3V. But then, as mentioned - not connecting 5V doesn't seem to be within spec.
[*]But then, connecting 5V and 3.3V would have the internal 3.3V and the external 3.3V regulators paralleled, probably not good. So I kind of like 101_fig6_d_adafruit_display_931_and_xmos_startkit_i2c_only_5v_and_pullup_to_3.3.jpg best.[/list]

Right now I am a little confused! Personally I can not spot the solution that's got it all correct. (Disclaimer about getting some of my words above wrong, even if I have proof read!-)

[1]
101_fig6_a_adafruit_display_931_and_xmos_startkit_i2c.zip
Adafruit display 931 and XMOS startKIT connected over I2C with 3.3V and 5V testing (archive)
(896.53 KiB) Downloaded 19 times
. (Observe different X-axis scaling of 1 and 2V) (Also at the url mentioned in my initial post. Disclaimer: I have no ads or income from my blog posts or what I describe there they are purely a hobby)

aclassifier
 
Posts: 17
Joined: Sun Jun 21, 2015 2:03 am

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by adafruit_support_mike on Tue Jun 23, 2015 10:51 pm

aclassifier wrote:The 931 web page says that "Built into the OLED driver is a simple switch-cap charge pump that turns 3.3v-5v into a high voltage drive for the OLEDs, making it one of the easiest ways to get an OLED into your project!". I can't see that this is accurate.

The breakout has a 3.3v regulator that accepts any voltage from 3.3v to 5v as input. The display driver has a built-in charge pump that boosts the 3.3v to about 7.5v, which is needed to make the physical display work. The DC/DC boost is mentioned on page 7 of the display datasheet: http://www.adafruit.com/datasheets/UG-2832HSWEG02.pdf

aclassifier wrote:I can not see that not connecting 5V is according to the "AN10441 Level shifting techniques in I2C-bus design" application note. Not also connecting 5V leaves a 10+10K between a floating middle point between SDA_5.0V and SCL_5.0V since the 3.3V SDA and SCL lines are internal only.

The level shifter works properly when Vin is connected to any voltage between about 2.8v and 12v.

- If a 3.3v signal on the source side goes to 0v, it opens the mosfet, creating a low-resistance path to the drain, and that pulls the drain voltage down to 0v as well.

- If a 3.3v signal on the drain side goes to 0v, the internal body diode pulls the source voltage down toward 0.65, but that source voltage is low enough to turn the mosfet on again, and the low channel resistance pulls the source voltage down to 0v.

- If neither side is low, both sides are held at 3.3v by their pull-up resistors.

Both sides see signal voltages of 0v and 3.3v, which are appropriate for a 3.3v I2C bus.

aclassifier wrote:But the 101_fig6_b and 101_fig6_c lift the lines to 5V, which is out of the startKIT's XS1-U16A-128-FB217 8-core spec.

We can't tell much from the scope traces without also seeing the connections. I'm not sure what the notations in the filenames indicate, and it isn't clear what you're measuring.

If you have a 3.3v device sending signals to the display, connect 3.3v to Vin and don't connect 5v to anything.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by aclassifier on Wed Jun 24, 2015 3:13 am

I didn't notice that the two caps (C1, C2) were for the charge pump (although I must admit I had a second thought on that after I pressed Submit) and I didn't consult the diagram (that I did have a copy of) this time, but thanks for getting that straightened out!

Ok, I won't connect VIN to 5V (only use the 3.3V line in), even if I don't like the small 10+10=20K connection between the SDA and SCL causing a small crosstalk. To limit that (and make better signals) I have added external 1.2K pull-ups from both lines to startKIT 3.3V output.

Perhaps your datasheet needs an update to reflect some of this discussion. Especially the one-or-the-other aspect of 3.3/5V as well as discussing any need of pull-ups. Even if it works with "almost sinus I2C" it's kind of better with "square" signals.

I like your response and what I've put my hands on!

Where's the description of the markups of this discussion framework? I failed on the ordered list in my last; I though it would be fixed after the preview.

aclassifier
 
Posts: 17
Joined: Sun Jun 21, 2015 2:03 am

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by adafruit_support_mike on Wed Jun 24, 2015 2:50 pm

aclassifier wrote:I don't like the small 10+10=20K connection between the SDA and SCL causing a small crosstalk.

The center of that connection is tied to Vin, so any crosstalk would be limited by the compliance of the power supply.

If we assume a microcontroller's output pin can maintain less than 5% droop at 25mA, a load will see an effective resistance of about 6.6 ohms. When you put that in series with a 10k resistor, you'll get a voltage divider whose center voltage swings about 660 microvolts per volt of swing at the far end of the 10k. A 3.3v swing on the 10k would produce about 2mV of swing visible to another 10k resistor connected to the same pin.

Those specs are awful compared to anything daring to call itself a voltage regulator, so you'd actually see complliance more like 1% droop at 100mA, for an effective resistance around 0.33 ohms, and a crosstalk voltage around 100uV.

Given that the resistors are connected to I2C pins whose high/low thresholds will be around 70% and 30% of Vcc (about 1v from either rail), the crosstalk is three to four orders of magnitude lower than anything the circuit can resolve.

aclassifier wrote:Where's the description of the markups of this discussion framework? I failed on the ordered list in my last; I though it would be fixed after the preview.

I don't remember where our tag glossary is off the top of my head. It's BBCode, so the information on this page is pretty good: http://www.bbcode.org/reference.php

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by aclassifier on Wed Jun 24, 2015 4:50 pm

The situation I was thinking about was 3.3V and nothing on VIN. I think you are referring to a connected VIN and nothing on 3.3? I agree that that crosstalk is not interesting as virtually "nothing" would cross over VIN.

However, I have drawn a suggestion of an equivalence diagram and simulated it in iCircuit (attached). Some of the values are really educated-a-very-long-time-ago guesses. VIN is only connected internally to 10uF and 10K bleeder for RT9193(?1) 3.3V in is connected to a 3.3V voltage source externally. One of the lines is pulled down with n-MOSFET(?2) Q1 and Q2 are just diodes(?3) For that particular example the crosstalk is about 400mV, interpreted as voltage swing on the "other line" when it should have been steady. It would fall to 18mV if I changed the serial resistor from 10K to 1M.

However, some of my assumptions may be wrong?
Attachments
101 fig7 A Adafruit equivalence diagram.tiff
101 fig7 A Adafruit equivalence diagram.tiff (402.99 KiB) Viewed 438 times

aclassifier
 
Posts: 17
Joined: Sun Jun 21, 2015 2:03 am

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by aclassifier on Wed Jun 24, 2015 5:06 pm

Here's one assumption. At 400 kHz (not 1Hz) the 10uF cap is so low impedance that the crossover would be in the sub mV area. Of course, I2C runs fast, so you are right. The crossover is very small!-) Case closed. Thanks!

aclassifier
 
Posts: 17
Joined: Sun Jun 21, 2015 2:03 am

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by adafruit_support_mike on Wed Jun 24, 2015 5:28 pm

You have to connect either 3.3v or 5v to Vin. If you're using a 3.3v microcontroller, connect 3.3v to Vin and don't connect 5v to anything.

The 3.3Vo pin is an output from the onboard voltage regulator. If you don't need to power an external circuit, don't connect anything to that.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by aclassifier on Wed Jun 24, 2015 5:44 pm

Thanks for your patience! Finally got it!

aclassifier
 
Posts: 17
Joined: Sun Jun 21, 2015 2:03 am

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by adafruit_support_mike on Thu Jun 25, 2015 12:33 am

Sometimes it takes a while to make the ideas line up the right way. Glad to hear they clicked for you.

Happy hacking!

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: 5V and/or 3.3V and logic levels with 128x32 I2C Display

by aclassifier on Thu Jun 25, 2015 5:12 pm

I've tried to summarize this at http://www.teigfam.net/oyvind/home/technology/101-my-bitscope-notes/#adafruit_display_and_i2c_with_xmos_startkit (standard disclaimer about my blog notes: no work, no gifts, no money, only hobby etc.) It's in BitScope context, but I haven't made a My adafruit notes yet. See you next time. Thanks. Øyvind

aclassifier
 
Posts: 17
Joined: Sun Jun 21, 2015 2:03 am

Please be positive and constructive with your questions and comments.