News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Interfacing 5V micros to small OLED displays.

Started by david, Oct 25, 2024, 12:47 AM

Previous topic - Next topic

david

Hi All,
I'm sure you're all familiar with the little 0.96" and 1.3" OLED displays and I've used a number of them in hobby projects without issue - until today.
A prototype breadboard using a 0.96" display worked fine so I changed it for a 1.3" display and it gave random pixels and eventually locked up.  On inspecting the two displays I saw that the 0.96 display had 4.7k pull ups while the 1.3" display had rather marginal 10k pull ups.   Adding two 3.9K resistors saw everything come right.
Now this has raised two questions.

1.  Refer to the attached schematic but ignore R1 and R2.  This is a typical OLED display with on-board regulator and pull ups to its internal 3.3V Vdd.  If using the micro's MSSP module there should be no problems as it's open drain logic.  But - when the display sends an ACK response back to the micro it may not quite meet the worst case logic levels.  The display sends a worst case high of 0.9xVdd (nom 2.97V) but the PIC needs 0.7x its Vdd (nom 3.5V) to meet I2C logic levels.  Is this a real problem?

2.  Now imagine we have added the external pull ups (R1, R2) but because we don't have access to the display's Vdd we take them to 5V.  Everything seems to work but are we stressing the ratings on the display which is typically a maximum logic level of 3.5V.  The display's on-board regulator can't sink current so if the display is off (or has minimal screen content) then the external pull up resistors may lift the voltage above its maximum rating. 

Now I can't believe everyone is using bi-directional level shifters on these jelly-bean displays but am I over-thinking the perils?

Cheers,
David

John Drew

Hello David,
I've normally made a direct connection to the hardware I2C. Maybe that is why I've noticed that the display life isn't great even with pixels normally off in standby.
They seem to lose sections of the display after several years.
Maybe it's a characteristic of early model oleds?
John

tumbleweed

#2
I wouldn't use pullups to 5V on a 3.3V device.

Check and see if your PIC has support for MSSP SMBus levels (typ found in SSPSTAT.CKE), or programmable levels via the INLVLx registers.
Or, run the uC at 3.3V if possible and you don't want to add level shifters.


david

Quote from: John Drew on Oct 25, 2024, 12:27 PMHello David,
I've normally made a direct connection to the hardware I2C. Maybe that is why I've noticed that the display life isn't great even with pixels normally off in standby.
They seem to lose sections of the display after several years.
Maybe it's a characteristic of early model oleds?
John

Hello John,
I'm sure there are millions of 5V Arduino users doing exactly that because many read the sales blurb stating suitable for 3-5V operation and go for it.  I believe some Arduino boards have their own pull-ups to 5V as well.  I think Sparkfun recognises the issue and has some displays with built in 3.3-5V bi-directional level shifters but I've never seen such a display on Aliexpress.
I don't know much about the lifetimes of these parts.  Maybe early ones were a little dodgy but they are also impacted by heat and contrast ratio.

Cheers,
David

david

Quote from: tumbleweed on Oct 25, 2024, 12:29 PMI wouldn't use pullups to 5V on a 3.3V device.

Check and see if your PIC has support for MSSP SMBus levels (typ found in SSPSTAT.CKE), or programmable levels via the INLVLx registers.
Or, run the uC at 3.3V if possible and you don't want to add level shifters.



I'm sure that's good advice but then why put a value like 10k on the lines?  As mentioned, if using the MSSP module there should be no issue regarding voltage levels but any bus capacitance with a 10k pull-up could be a problem at even modest I2C speeds.  They should either use lower resistance values or give access to the display chip's Vdd.   This still ignores the possible ACK level limitation coming from the display to the micro.
For many applications, adding a SMT resistor in shunt with the existing display pull-ups may be enough to ensure full speed operation without exceeding voltage specifications.  Using a 3.3V micro overcomes all issues but doesn't fit well with my need to generate a 0-4V DAC output.

Cheers,
David

JonW

Many i2c busses are designed to be 5V tolerant. In addition many lcd drivers have charge pumps to derive higher voltages thus the IC process voltage would likely be a 12V process or something similar.

david

Interesting comments but I think for the SSD1315 display chip they seem to be quite specific, as per the attached spec.   Absolute maximum for the logic pins is given as 4.0V with 3.5V given as operating maximum.

Also attached is a crude model of what I think the situation is.  It shows the on-board 10k pull-up with a series 100R to the chip's input.  I'm assuming there will be a gate protection diode or substrate diode that would clamp to the 3.3V supply.
So provided the load on the regulator is greater than "fault" current shown then it should clamp very close to the 4V limit when additional pull-ups to the 5V supply are added.  This may be why there is no wide spread reported failure of these displays in 5V applications.
That said.... I just wish they would make 5V tolerant inputs or add level shifters to the display board.  It already has the 3.3V regulator so it makes sense to place the shifters there too.

JonW

Then it's probably 2 ICs under the blob. Driver and controller.  Agree it wouldn't cost much to add a level shifter but in an aggressive market that may be the profit or the business shifted to a competitor who doesn't have them.

david

#8
I'm beginning to think it's not the weak pull-ups that are a problem but more likely the limited logic high during an ACK exchange from the display to the micro.
When running the micro at 4V the display is fine but breaks up and freezes with the micro at 5V.  This appears to indicate a level issue.
Also, if using software I2C there is no issue at the higher micro voltage because it's using (probably) TTL levels as opposed to dedicated Schmitt trigger I2C levels.   A TTL logic high is only 2V as opposed to 3.5V for the I2C
If using the MSSP module then adding 4.7k pull-ups to both SCL and SDA to +5V doesn't help but a single pull-up on SDA works well.  I can't figure that one out.
Adding level shifting would be the correct way to go.  If it was done on the display then it's only adding two N ch logic level FETs. The regulator and pull-ups to 3.3V are already there.
Stick with software I2C and you'll be blissfully unaware of any problems with the displays.  Unfortunately, I need a fairly fast screen write time.

Cheers,
David

david

A final note on this saga with displays.
I found the regulator on the 1.3" display was only showing around 2.8- 2.9V and was seriously noisy - up to about 1v pk-pk of low frequency flutter.  I got a second display off a friend - same make and model and it was equally bad.  The regulator in question is a SOT-23 Torex part marked 662k and is widely used.  Confused by this I then removed the regulator off a smaller 0.96" display which did measure 3.3V and was the same Torex part.  On the larger board it delivered 2.9V and was noisy again.  I was now convinced the regulator on the larger display was oscillating and fitting a 1uF chip ceramic directly across the Gnd - Output pins made it all come right.  I tried the same on a second board and it came right also with noise level around 50mV.  The display was now happy running directly off the MSSP module of a 5V micro.  Previously the low average voltage and extreme noise caused the ACK signal to be mostly ignored by the micro.
It's a while since I've seen an oscillating regulator but we shouldn't forget they are single sided, high gain, low bandwidth amplifiers.  Now I can get back to micro problems....

Cheers,
David

JonW

I doubt it's torex these are normally really stable, there are hundreds of these regs made in China with the same name but not the same performance.  Most are based on the old LDO uncompensated designs.  The ESR and capacitance value if the output cap is critical for stability. I'll check all my displays as I have seen some funny startup issues on some and this is likely the reason.

david

I suspect you're right and it was just that Torex came up first in the marking code search.  A second look is showing different manufacturers for the same marking code so there could well be multiple "Happy Duck" makers of the same part.
The problem with really stable regulators is that they tend to have slow load transient performance but that's not an issue for these displays.

David

Dompie

@david Can you take a picture of your modification. I also have a handful of these displays in use and sometimes see strange things that I as a civil engineer do not understand but your solution could work for me too.

Greetings
Johan

david

This is the modification I did but of course there are multiple makers of these displays and different revision numbers from the same manufacturer.  Mine is marked  1.30" IIC V1.1 1315.  The second picture shows an identical display but with V2.0
I used an 0603 1uF part directly across the pins of the SOT-23 regulator package.

Dompie

#14
@david Thank you. Absolutely clear. I have lots of the v1.1one. Even a civil engineer can modify this. ;D  ;D

Greetings
Johan


david

Hello Johan.  It would be worth checking them to see if the regulator output is close to 3.3V.  The regulator output pin is on the side opposite from the arrow in my blurry picture.  Ground pin is next to the arrow head.  R3 and R4 are the I2C pull-ups which on my boards are 10k.  This is fine if it's a short bus with no other devices on it.  A standard 1:1 scope probe may corrupt the waveform if checking waveforms.  The ACK signal from display to micro will be the first to cause problems because of the lower voltage.  Software I2C was surprisingly tolerant but the chip I was using had the option to change the logic threshold of the inputs which I had set to TTL.  The MSSP module complies with I2C standards with logic low at 0.3xVdd and logic high at 0.7xVdd.

Cheers,
David

Dompie

I will indeed first check if the 3.3V (approximately) is present because I discovered that a 0603 is small. Modifying fewer displays is therefore very attractive.

Greetings
Johan

david

Hi,
They should be 3.3V +/-3% and I would apply the capacitor if it's below 3.1V.
0603 is not small - 0201 is small and I have built prototype boards at work using them only to find the mini-reel from DigiKey was incorrectly marked.  You just need good light, a good head magnifier and good tweezers.  Tin the two pads of the SOT-23 with Pb/Sn solder first - it won't move and it will make soldering the capacitor easier.  Add the capacitor and tack one end down then the other.  Check the voltage afterwards in case you've messed up.   Good luck - if you need to do any modifications.

Cheers,
David

top204

#18
Excellent work David, or should I call you Monsieur Poirot? :-)

I've come across similar problems in the past as well, where someone has taken the regulator's datasheet too literally, and use capacitors that are too small for the regulator in a real world application, and causes strange faults in circuits that I have had to create software for, because of noise or poor regulation when the current increases, and the voltage starts wavering.

I agree, 0603 is not actually classed as small now, whereas 0403 are still quite small, and 0201 are crazy tiny.

Under a twin microscope, 0603 components are reasonable to work with, with a good pair of pointed tweezers and a fine soldering iron tip, and using a liquid flux. And 0805 components are giants under a microscope.

Some of the digital LCD display microscopes are now quite inexpensive, and very good to work under.

Dompie

#19
0201 that means 0.5x0.25mm!!!! WOW. That is not for people of my age. So I have to be very happy with the 0603 size.
Quote from: david on Oct 28, 2024, 11:39 PM...  Check the voltage afterwards in case you've messed up....
Ahhhh you know me

Greetings
Johan