having trouble using I2C oled display

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Liin
Level 1
Level 1
First like received First reply posted First question asked

Hello,

i'm trying to program an I2C OLED display 128x64 SSD1306 on PSOC5 but nothing appear on the screen. I'm using 4,7k pull-up resistors for SCL and SDA pins.

Can someone tell if there is something i'm doing wrong please ?

Thank you for your help in advance !

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Coincidently I wrote a sample program of SSD1306 for PSoC 4 last week.


Today, I ported it for PSoC 5LP (CY8CKIT-059).
https://community.infineon.com/t5/Code-Examples/SSD1306-I2C-OLED-128x64-PSoC-5LP-CY8CKIT-059/m-p/390...

IMG_5416.JPG

moto

View solution in original post

0 Likes
3 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

You needed to add charge pump setting 0x8D, 0x14

So I modified your display_init() as follows

 

// call before first use of other functions
void display_init( uint8 i2caddr ){
    
    _i2caddr = i2caddr;
    gfx_init( DISPLAYWIDTH, DISPLAYHEIGHT );
    
    uint8 cmdbuf[] = {
        0x00,
        SSD1306_DISPLAYOFF,
        SSD1306_SETDISPLAYCLOCKDIV,
        0x80,
        SSD1306_SETMULTIPLEX,
        0x3f,
        SSD1306_SETDISPLAYOFFSET,
        0x00,
        SSD1306_SETSTARTLINE | 0x0,
        SSD1306_CHARGEPUMP,
        0x14,
        SSD1306_MEMORYMODE,
        0x00,
        SSD1306_SEGREMAP | 0x1,
        SSD1306_COMSCANDEC,
        SSD1306_SETCOMPINS,
        0x12,
        SSD1306_SETCONTRAST,
        0xcf,
        SSD1306_SETPRECHARGE,
        0xf1,
        SSD1306_SETVCOMDETECT,
        0x40,
        0x8D, 0x14, // Set Charge Pump Setting (0x14: Enable Charge Pump)
        SSD1306_DISPLAYALLON_RESUME,
        SSD1306_NORMALDISPLAY,
        SSD1306_DISPLAYON
    };
    
    display_write_buf( cmdbuf, sizeof(cmdbuf) ); 
}

 

moto

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Coincidently I wrote a sample program of SSD1306 for PSoC 4 last week.


Today, I ported it for PSoC 5LP (CY8CKIT-059).
https://community.infineon.com/t5/Code-Examples/SSD1306-I2C-OLED-128x64-PSoC-5LP-CY8CKIT-059/m-p/390...

IMG_5416.JPG

moto

0 Likes

Hello, I tried adding this line and it works perfectly fine now ! Thank you for your answer.