I noticed that if I have two SSD1306 displays, the 128x32 display will lose every other row if written in x64 mode, and the 128x64 display will show blank horizontal lines if written in x32 mode. How does this physically work, and can I expect this to be a reliable feature?

I would have thought that half the screen would get cut off somehow, but it appears that it must interlace the data instead (which seems a lot more complicated). Yet there's also some sort of configuration to the driver chip to make it do this (It seems to be the 0xDA command, but I'm not clear how/why it has these options).

Can I expect that, at least if I use the same driver library, that using the wrong screen will always have this behavior? I was planning to use it to help the user detect what screen they have.

  • What does your own efforts reveal? What does the data sheet say? Did you look into the driver's source? You can answer most of your questions yourself with some web recherche and reading. Mar 9, 2020 at 18:54
  • I looked up the datasheet, and there is some sort of muxing going on, but I didn't really understand it much, and some of it is library/implementation specific. As apparently mentioned below, it's a convention thing apparently...
    – user47164
    Mar 10, 2020 at 18:37

1 Answer 1


The SSD1306 does not handle different sizes, it's ever only handling it's maximum size 128x64. But one can decide to only use less pins of the driver for a smaller display.

The SSD1306 has 128 segment pins, which activate the current column, so that the states of the 64 common signal pins will be used by the display for that column. For smaller display sizes there are just some pins of the SSD1306 left unconnected. They get set like all the other pins, but they are not connected to anything, thus the information gets lost.

For accommodating that, the library sets the pixel according to the size by not using every second row (aka common signal) for half size displays. That's why you get horizontal black lines, when using a 128x64 display with the library in 128x32 mode. The library thinks, that every second row is not connected either way and thus sets these pixels to black. The 128x32 display is loosing every second row when used with the library in 128x64 mode, because every second row is not connected.

Note, that nor the library neither the SSD1306 know about how the display is connected. You need to tell the library this, by setting the mode, and it will control the SSD1306 accordingly. So there is no feedback about the display, that you could use.

Can I expect that, at least if I use the same driver library, that using the wrong screen will always have this behavior?

Yes and no. The library handles it this way, because it is the common way to leave out every second pin for displays of half size. But it comes down to the manufacturer to decide this. We cannot guarantee, that nobody will ever connect the SSD1306 in a different way to a display.

For most manufacturers you will be good. If you simply plan to provide the displays for your user, so that they can change them their selves, you can be sure. If the user should be able to use her/his own display, purchased anywhere else, you might run into problems (though rarely).

  • I'd be providing the screens, so that part at least is easy. The worrying part is how do I know if the ones I'll be buying are wired normally...
    – user47164
    Mar 10, 2020 at 18:33
  • By trying, just as you already did
    – chrisl
    Mar 10, 2020 at 19:07
  • ...Thanks? That's not really the most encouraging...
    – user47164
    Mar 15, 2020 at 3:57
  • Depending on where you are buying them, you might be able to get this information from the reseller/manufacturer. You will be fine in most cases. When you have found a reseller, that is selling the correctly wired modules, just buy the modules from him. There is no study, how many modules are wired that way,but I think it will be the wast majority of cases
    – chrisl
    Mar 15, 2020 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.