Adafruit 2.3" 128x32 OLED Display - stretched

Hi all,

In need of an expert please…

I have the Adafruit 2.3" 128x32 OLED Display (link) running SPI on a Pro Micro and it does work (lights up, runs tests etc). However, the display is stretched vertically as if it’s a 256x32 display. This is true using both Adafruit’s SSD1306 lib (checked in the .h file and amended correct line to 128x32), or the U8G library (using U8GLIB_SSD1306_128X32).

Looking at the display through a magnifier it looks like it’s skipping every other line drawn (so for a 5 pixel high character it’s actually taking 10 pixels, “10101010” instead of “11111” for example).

I’ve searched through as many posts and pages as I can find, tried various sketches and libraries, but nothing I do makes this display actually display as 128x32 correctly.

Attached images to this post so you can see what I mean.

What am I missing?

yours,

Hopefull

Hmmm, it works with an UNO.

So I thought maybe it's because I'm driving the display from the 5v Pro Micro (ATmega32U4 5v, 16MHz), and maybe the display wasn't liking that. Changed the display supply from the UNO to 5v, it still worked OK.

This makes me think there could be one or maybe more of the following factors at play:

  1. Board speed
  2. Line stability (power supply to display)
  3. Something intrinsic to the UNO that I have no idea of!

Any advice?

pwhitrow: So I thought maybe it's because I'm driving the display from the 5v Pro Micro (ATmega32U4 5v, 16MHz), and maybe the display wasn't liking that. Changed the display supply from the UNO to 5v, it still worked OK.

I thought that display was 3V only, if you have supplied it with 5V and/or driven it with 5V signals you could damage it or quite possibly make it do strange things.

Yours, TonyWilk

Totally agree about the 3v rating, and have tried both with and without the level shifter in place, resulting in:

  1. UNO with level shifter - perfect display
  2. UNO without level shifter (display at 5v) - perfect display
  3. PRO MICRO with level shifter (external 3v supplied) - wrong display as described
  4. PRO MICRO without level shifter (display at 5v) - wrong display as described
  5. Teensy 3.2 with level shifter - wrong display as described
  6. Teensy 3.2 without level shifter - wrong display as described

So far the ONLY board this display has worked on is the UNO, with or without the level shifter.

Problem persists, so more digging...

Go on. Adafruit clearly state 3.3V logic. If you choose to stress the chips with 5V they will suffer permanent damage. They are probably already damaged.

Teensy3.2 is 3.3V. It should work fine. If not, post details and I am sure that Adafruit.com and pjrc.com will help. Either Adafruit, Forum Users or Mr Stoffregen himself.

If you obey the hardware rules, it sounds like a software problem e.g. you have wrong constructor. Make sure that you prepare your questions/problems carefully.

If you flout the hardware rules, you will not get much sympathy. Why should people waste their time when your problems are self-inflicted?

David.

Did you try adding the 220uF capacitor to the supply rails that Adafruit suggests on their product web page? Apparently that OLED module’s boost converter is causing glitches.

Yes, should have been using 3.3v logic (or level shifter when used with 5v processor) per the display controller (SSD1306) datasheet.

David, my bad for not forming explanations better.

To clarify, I have two displays, the first of which I stuck straight on the 5v Pro Micro (mainly to see if it would work at all) as this small board is perfect for the projects needs. After the initial results (not working correctly) I tried the second display on the UNO with a level shifter as described and wired correctly, with capacitor, and the display worked. So I know at least the second display is a good working version and has not been stressed by over powering. This is the display I'm using on the Teensy 3.2 with 3.3v and level shifter, but am getting the erroneous display (namely the stretched out vertically result). I have changed the Adafruit_SSD1306.h file to be 128x32 as instructed.

I can only assume there is a library/software issue somewhere as swapping either of the displays back onto the UNO shows them working correctly.

I can't however use the UNO for my project as there is a size restriction, hence looking at the Prop Micro and Teensy 3.2

So any further help would be greatly appreciated.

You do seem to have covered all the angles... only working on the UNO is pretty odd.

Just a shot in the dark here:

Try adding a 100 ohm resistor in series with the clk output pin on the Pro micro or teensy. (thinking the long wiring may be causing bother with the faster clk)

A photo of your setup with the level shifter in place might be useful as well.

Yours, TonyWilk

Any shots are welcome mate, including long ones! Tried the 100 ohm but made no difference.

Image attached, and below is the setup code for using the Teensy 3.2:

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>


// If using software SPI (the default case):
#define OLED_MOSI   9
#define OLED_CLK   10
#define OLED_DC    11
#define OLED_CS    12
#define OLED_RESET 14
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

borland: Apparently that OLED module's boost converter is causing glitches.

Has this been stated anywhere? Would like to read about it but can't find anything after searching for info.

pwhitrow: Any shots are welcome mate, including long ones! Tried the 100 ohm but made no difference.

Right... longer shot... :)

0.1uf and 10uF (or 100uF or whatever) both across 0V - Vcc directly on the Oled module

Yours, TonyWilk

pwhitrow: Has this been stated anywhere? Would like to read about it but can't find anything after searching for info.

"We also toss in a 220uF capacitor, as we noticed an Arduino may need a little more capacitance on the 3.3V power supply for this big display!"

https://learn.adafruit.com/2-3-monochrome-128x32-oled-display-module/overview

pwhitrow: Totally agree about the 3v rating, and have tried both with and without the level shifter in place, resulting in:

  1. UNO with level shifter - perfect display
  2. UNO without level shifter (display at 5v) - perfect display
  3. PRO MICRO with level shifter (external 3v supplied) - wrong display as described
  4. PRO MICRO without level shifter (display at 5v) - wrong display as described
  5. Teensy 3.2 with level shifter - wrong display as described
  6. Teensy 3.2 without level shifter - wrong display as described

So far the ONLY board this display has worked on is the UNO, with or without the level shifter.

Problem persists, so more digging...

The Pro Micro is 32U4. The Teensy3.2 is a K20. Since you are using the bit-bang software constructor() all Targets should work the same (with 3.3V GPIO)

I only have 128x64 0.96" OLED. But it works just fine with 3.3V logic. On 3.3V Seeeduino, Zero, Due, Teensy3.2, STM32.

The initialisation sequence might be slightly different with a big 2.3" display. e.g. internal voltage generators, ... But the actual User commands will be identical.

Always use the Library Manager. Quote version numbers. Quote which example sketch has produced your photos.

David.