Blank bar on 256x64 SSD1322 OLED display

Hi guys, I'm trying integrate a arduino nano and a 256x64 SSD1322 2.7inch OLED display using the u8g2 library, but when I upload the code to the arduino, this white bar appears on the right side and the zero position is out of the screen. Has anyone had this type of problem and managed to fix it?

This is my code:

#include <U8g2lib.h>

U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI u8g2(U8G2_MIRROR, 13, 11, 10, 9, 8);

void setup(void)
{
    u8g2.begin();
}

void loop(void)
{
    u8g2.firstPage();
    do
    {
        u8g2.setFont(u8g2_font_ncenB10_tr);
        u8g2.drawStr(16, 24, "Hello World!");
    } while (u8g2.nextPage());
}

You are telling the library the wrong size screen.

But I using the size screen specified on the back display:

So you are right about the size but do not have it working. Check how u8g wants info.

When I send an image to an OLED with the wrong information, "snow happens" and I fix the size/info.

Are these pins right?

Yes, the right side is the oled pins
13: SCL
11: SDA
10: CS
9: DC
8: RESET

The library says this... and your code still looks good (mirror = rotation)

U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE)

Have you tried a different font? That seems to be the only thing that could extend beyond the screen border.

[EDIT]

The "1_4W" after 256X64_ could be significant... there are 21choices. : )
Do you know why "1_4W" was chosen?

[EDIT]
What other choices do you have but "MIRROR"?

In 1_4W the number 1 is related to the buffer size. 1 is 256, 2 is 512 and F is 2048. 4W is the number of wires connected.

Which version of the U8g2 library are you using?

If you are not using the current version, check the u8g2.h file (located at Arduino/libraries/U8g2/src/clib/u8g2.h) to verify the following define line is not commented out:

/*
  The following macro enables 16 Bit mode. 
  Without defining this macro all calculations are done with 8 Bit (1 Byte) variables.
  Especially on AVR architecture, this will save some space. 
  If this macro is defined, then U8g2 will switch to 16 Bit mode.
  Use 16 Bit mode for any display with more than 240 pixel in one 
  direction.
*/
#define U8G2_16BIT

I’m using the latest version and I check this line and it’s uncommented

Do you get the same problem if you use u8x8?

Have you tried hardware SPI instead of software SPI?

Would you try "U8G2_R0" for the rotation?
Also, did you try a larger buffer size?

If nothing suggested here fixed the problem, there is a discussion section of the U8g2 github, you might want to ask there.

Maybe its not an SSD1322. Please try a different controller. E.g. the SH1122

I tried with SH1122 and the screen doesn’t turn on

With full buffer size the screen doesn’t turn on and using the U8G2_R0 the text is mirrored

You shouldn't even be able so successfully compile for a Nano (atmega328 based) with a full buffer, a 256x64 display needs 2048 bytes of ram, which is all the ram available.

SuperNano? 0% available RAM?

There are multiple boards with "Nano" in the name, all the way up to an ESP32, so it would be possible to compile on some of them.

I fixed it by changing some values in the display configuration file named u8x8_d_ssd1322.c. I tried several different values until I found the correct value.