This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Example at ...\ncs\v1.4.0\zephyr\samples\drivers\display does not work with SSD1306 wired directly to nRF9160DK

When I program the nrf9160dk with the example, the code detects the SSD1306, but the display looks like:

The image is only using the middle half (16 rows) of the display that has 32 rows and 128 columns. 

And the left side of the image is a random set of pixels.

What can I do to get the example to give me text on the screen?

I am using the SSD1306 OLED at: https://www.amazon.com/Pieces-Display-Module-SSD1306-3-3V-5V/dp/B08CDN5PSJ/ref=sr_1_8?dchild=1&keywords=ssd1306&qid=1606702037&sr=8-8

Do I have to modify any of the files to target the nRF9160 instead of the nRF52 family?

Parents Reply Children
  • Hi Craig,

    Sorry for not replying, I am currently on vacation. I will continue working on this when I am back the first week of January. Below is the current status on my side:

    I got the example to compile and I flashed the nRF9160 DK, however, the display was completely black. I am not entirely sure I powered the display correctly.

    Would you be able to share the code that produced the pattern which is visible in the image you shared initially? Or is this the code that you already shared?

    Which voltage are you powering your display with? I am worried the I/O-voltages are not high enough. From the limited documentation for the display(the images in the Amazon-link you shared), It looks like the I/O-voltages of the display requires VIH_Min = 0.8V x Vcc. If Vcc = 5V, then the 3V I/O from the DK might not be sufficient. Please correct me if I am wrong. As I was writing this I read one of the comments on the Amazon ad: '[...]the product is supposed to support 3.3v to 5v as claimed in title, but in fact it only supports 5v[...]'. This, however, is not consistent with the table.

  • Today I was able to reproduce a similar pattern as you.

    I will keep you posted when I find something.

  • A colleague has some suggestions that you could try. I will try this myself next week.

    He suggests to add this to your overlay:

    &twim2 {
    status = "okay";
    concat-buf-size = <1024>;
    };
    It would then look something like this:
    &twim2 {
        status = "okay";
        concat-buf-size = <1024>;
    };
    
    
    &i2c2 {
        status = "okay";
        compatible = "nordic,nrf-twim";
        sda-pin = <30>;
        scl-pin = <31>;
        clock-frequency = <I2C_BITRATE_FAST>;
        ssd1306@3c {
            compatible = "solomon,ssd1306fb";
            reg = <0x3c>;
            label = "SSD1306";
            width = <128>;
            height = <32>;
            segment-offset = <0>;
            page-offset = <0>;
            display-offset = <0>;
            segment-remap;
            com-invdir;
            prechargep = <0x22>;
            multiplex-ratio = <31>;
        };
    };
    Also try these configs:
    CONFIG_I2C=y
    CONFIG_I2C_NRFX=y
    CONFIG_NRFX_TWIM2=y
Related