Skip to content

Problems with 96x16 OLED display #1482

Open
@1kvin

Description

@1kvin

Target name(s)

ESP32_C3_REV3

Firmware version

ESP32_C3_REV3-1.9.1.75

Was working before? On which version?

No response

Device capabilities

No response

Description

I'm seeing problems with the display. The standard example does not work, I decided to try to figure out the problem and used a modified initialization from here.

Here is the solution that works for me:

using var device = new Ssd1306(
      I2cDevice.Create(
        new I2cConnectionSettings(
            1,
            Ssd1306.DefaultI2cAddress,
            I2cBusSpeed.FastMode)),
    Ssd13xx.DisplayResolution.OLED96x16
    );

var init = new byte[]
   {
    0x00,       // is command
    0xae,       // turn display off
    0xd5, 0x80, // set display clock divide ratio/oscillator,  set ratio = 0x80
    0xa8, 0x0F, // set multiplex ratio 0x00-0x1f        
    0xd3, 0x00, // set display offset 0x00-0x3f, no offset = 0x00
    0x40, // set display start line 0x40-0x7F
    0x8d, 0x14, // set charge pump,  enable  = 0x14  disable = 0x10
    0x20, 0x00, // 0x20 set memory address mode,  0x0 = horizontal addressing mode
    //0xa0 | 0xA1, // set segment re-map
    0xc8,       // set com output scan direction
    0xda, 0x02, // set COM pins HW configuration
    0x81, 0xaf, // set contrast control for BANK0, extVcc = 0x9F,  internal = 0xcf
    0xd9, 0xf1, // set pre-charge period  to 0xf1,  if extVcc then set to 0x22
    0xdb,       // set VCOMH deselect level
    0x2e,       // Deactivate scroll
    0xa4,       // set display ON
    0xa6,       // set normal display
    0xaf        // turn display on 0xaf
   };

device.SendData(new SpanByte(init));
device.SendCommand(new SetSegmentReMap(true));

Maybe it's a copy paste victim

How to reproduce

No response

Expected behaviour

No response

Screenshots

No response

Aditional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions