NRF 52 OLED SSD 1306 SEGGER

Hello to all

I am quite lost, I need help to connect an oled to my project. The rest of the stages I have it complete, but my experience with OLED, is limited to arduino with U8G2 type libraries, that is, I don't know how to connect and configure my display with my board.

I am using NRF52DK and segger Studio.

Any recommendations on how I should start, or example with my environment?

Thank you very much

Parents Reply Children
  • DBdani said:
    Can i use this example with segger Embedded Studio?

    Yes. You can use the example regardless of whether you choose to use Segger Embedded Studio, Visual Studio Code or command line. For building applications, Visual Studio Code with the nRF Connect for VS Code extension is our recommendation. For more information about the extension, see the nRF Connect for Visual Studio Code documentation page.

    DBdani said:
    ÂżWhat advantage have nRF Connect SDK?

    nRF Connect SDK is our main SDK onward while the nRF5 SDK is in maintenance mode. Please see the nRF Connect SDK and nRF5 SDK statement for details. Which SDK you choose is up to you, however, we recommend nRF Connect SDK for all new projects as this is the SDK where fixes, updates and new features will be implemented.

    Also see the Introduction page at nRF Connect SDK documentation for details about nRF Connect SDK. Check out the getting started page for nRF Connect SDK as well as the mentioned Nordic Developer Academy.

  • Hello Helsing,

    From the recommendations I am using visual studio with zephyr, and I have done the recommended tutorial.

    I am trying to compile the code in your post to use oled and I am getting compile errors.

    the console say this

    Thank you

  • I was able to reproduce the same or similar errors when trying to build without any overlay file.

    Did you create any .overlay file? Check under input files if there is any such file.

    If not present, click where it says "Click to generate overlay". Then add the following to the generated(empty) file:

    &pinctrl {
        i2c0_default: i2c0_default {
            group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
                    <NRF_PSEL(TWIM_SCL, 0, 27)>;
            };
        };
    
        i2c0_sleep: i2c0_sleep {
            group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
                    <NRF_PSEL(TWIM_SCL, 0, 27)>;
                low-power-enable;
            };
        };
    };
    
    arduino_i2c: &i2c0 {
    	compatible = "nordic,nrf-twim";
    	status = "okay";
    	clock-frequency = <I2C_BITRATE_FAST>;   
        zephyr,concat-buf-size = <4096>;
      
        ssd1306: ssd1306@3c {
            compatible = "solomon,ssd1306fb";
            reg = <0x3c>; //0x3c is the i2c address of the SSD1306 aIC.
            width = <128>;
            height = <32>; // Change to '64' when using the 128x64 pixel version.
            segment-offset = <0>;
            page-offset = <0>;
            display-offset = <0>;
            multiplex-ratio = <31>; //change to '63' when using the 128x64 pixel version
            segment-remap;
            com-invdir;
            com-sequential;
            prechargep = <0x22>;
        };
    };
    	

    I selected i2c0 for nRF52 DK.

    Please report back how this goes.

    I tried building with nRF Connect SDK v2.1.2 but I did test it on the DK as I did not have any nRF52 DK at hand today. I will try flashing the board tomorrow.

  • Hello Helsing,

    Thank you for your reply

    I try to generate overlay file, and now i have two new problems:

    I'm lost with this issue.

    Thank you very much

  • Have you taken the shield into use? I am getting a similar error as you if I remove references to the ssd1306 shield. Try adding this line of code to the file CMakeLists.txt in your project folder: set(SHIELD ssd1306_128x32).

    Add the line just below cmake_minimum_required(VERSION 3.20.0).

Related