Custom hardware: OLED SH1106 screen vs SSD1306


For the record, if anybody wants to use a Sh1106 screen often found on 1.3" breakout boards instead of a SSD1306 often found on 0.96" breakouts, here is the small modification needed to make it work:

Library modifications for different OLED drivers
DIY Arduboy - problem with screen
$12 Arduboy compatible system
$12 Arduboy compatible system
(Mike McRoberts) #2

Does this work with the ArduBoy 2 library?

(Scott) #3

It should. You’ll have to customise the Arduboy2 library each time you update to a new release, though. And, you’ll need to revert the changes to use a SSD1306 display.


Thanks for the pointer @MLXXXp

Just wondering, to use a SH1106 screen, what do we do? Just swap out / replace core.cpp?

Is it compatible with the latest libraries? I note that @Dreamer3 mentioned the changes might not be necessary if the screen has continuous addressing mode.or something, but I can’t code my way out of a paper bag to understand that.

Has anyone used a SH1106 screen in their Arduboy build?

(Scott) #5

I believe the problem is that the SSD1306 has a 128 x 64 bit array of RAM that maps directly to the 128 x 64 pixels on the display. The SH1106 has a 132 x 64 bit RAM array that maps onto the same 128 x 64 pixel display, so there are an extra 4 bits of RAM per row that aren’t used. The code changes compensate for this difference by skipping those extra bits when writing rows to the screen.

If you wanted to modify the Arduboy2 library, you would have to change the display initialization and paintScreen() functions in the same way as was done for the Arduboy library.

You can’t just swap in the Arduboy library’s core.cpp. They have diverged too much since these changes were made.

I haven’t researched it enough to be sure, but you may be able to get away with just initializing the display in a different way.

If anyone is interested in looking into this, the datasheet for the SH1106 is here: