olikraus / u8g2

U8glib library for monochrome displays, version 2
Other
4.9k stars 1.02k forks source link

Difference between SSD1306_NONAME and SSD1306_1F? (Wiki update) #2320

Open olikraus opened 6 months ago

olikraus commented 6 months ago

Discussed in https://github.com/olikraus/u8g2/discussions/2317

Originally posted by **egnor** December 8, 2023 I am using a [64x32 OLED from buydisplay/EastRising](https://www.buydisplay.com/white-0-49-inch-oled-display-64x32-iic-i2c-ssd1306-connector-fpc) using I2C and had a bunch of struggle before realizing that `SSD1306_NONAME` doesn't work for me (garbled junk on screen) and `SSD1306_1F` works perfectly. In code, the main difference is that the `_1F` flavor uses a multiplexing ratio value of 0x1f (hence the name?), `_NONAME` uses 0x2f. That corresponds to 32-way row driving (0x1f) or 48-way row driving (0x2f). I can't imagine why a 64x32 OLED would use 48-way row driving, but... the world is full of strange things... I'm now gathering that accepted practice is just to try all variants of a particular display to see what works. Perhaps this could be noted in the "Setup" documents? If the situation is clarified, I'm happy to edit the wiki / code as needed to save others similar confusion.
olikraus commented 6 months ago

see discussion for details

egnor commented 6 months ago

Proposal copied over from the discussion: Edit the u8g2setupcpp wiki page as follows, with my additions marked by πŸ†• (delete the mark before merging!):


Constructor Name

The name of the Arduino C++ constructor has the following parts:

No Description Example
1 Prefix U8G2
2 Display Controller UC1701
3 Display Name DOGS102
πŸ†• 4 πŸ†• Variant (optional) πŸ†• ALT
5 Buffer Size 1, 2 or F (full frame buffer)
6 Communication 4W_SW_SPI

These parts are connect with _. The full constructor name for the example will be U8G2_UC1701_DOGS102_ALT_1_4W_SW_SPI. All available constructor names are listed in the reference section below.

πŸ†• If multiple variants are available for a display name, you may need to experiment to find the one that works for you. Small unbranded displays often come in "flavors" that have important differences but aren't marked on the packaging!


Those edits should apply to u8x8setupcpp as well. Similarly, I'd edit the u8g2setupc page like this:


Setup Naming Convention

Each setup procedure name has the following naming convention:

u8g2_Setup_<display>_πŸ†•<variant>_<i2c>_<memory>

πŸ†• When multiple variants (_ALT, _1F, etc.) are available, you may need to experiment to find the one that works for you. Small unbranded displays often come in "flavors" that have important differences but aren't marked on the packaging!

In any case, the naming convention is just a rough guide; the actual function names and their possible arguments are listed below.


DocMoebiuz commented 2 months ago

Thanks for this clarification, it would be awesome to have this on the docs, I was scratching my head trying to figure out what _1,_2,_F would mean.

olikraus commented 2 months ago

That _1, _2, _F should have been mentioned, but I like the addon from @egnor