NRF connect won't use the SUPPLY pin for SSD1306?

Hello!

I am working on a project based on NRF52832 MCU and NRC connect SDK in VS Code.

I have a custom PCB and I use GPIO pins to switch on the power of the OLED display.

When I was developing the code I was not able to get the display working for a long time before discovering

that SDK's ssd1306 driver does not make any use of the SUPPLY pin regardless that it can be specified in the devicetree

for the ssd1306 device.

I was able to add the functionality to switch the supply on using the SUPPLY by modifying the driver.

The problem that I am still facing is that I want to turn off the display completely when I put the device to sleep since the display consumes a lot of power.

When I switch the supply of the display off, then I would need to re-initialize it when the device needs to become active, but the initialization of the ssd1306 is done somewhere under the hood of zephyr and not like in good programming environments.

Could anyone help me understanding how I could properly re-init the display when I need to turn it on again?

I am using v2.6.2. Is this problem solved in more recent SDK's?

With best wishes,

Marek

  • Hi Marek, 

    Just to understand your issue a little better. Do you have a nRF52 DK to test with as well?

    The problem that I am still facing is that I want to turn off the display completely when I put the device to sleep since the display consumes a lot of power.

    Does this mean that the display is working i.e. you get text on the display?

    Are you able to share your project or just the part related to SSD1306? I.e. code and KCONFIG configurations, etc.

    Kind regards,
    Øyvind

  • Thank you, Øyvind, for replying.

    As i wrote, the SSD1306 OLED is included in the zephyr and user can specify also two pins - RESET and SUPPLY. 

    I got the display working after I added few lines of code that sets the specified SUPPLY pin high in the function "static int ssd1306_init_device(const struct device *dev)"  in the ssd1306.c file. 

    It works only after the resetting the MCU since this function is not called from the main but is handled somewhere in the zephyr.

    Just after MCU reset it works as a display should, I can write text on it but it but I cant turn it off properly and then turn it on again is software.

    Currently when the device is idle, it consumes a lot of current, several mA, because of the display is powered. I can easily turn the display power off, but when I turn it back on after exiting idle state I need to initialize the display like it is done after the MCU reset, but as the handling of that function was originally done somewhere under the hood and not in main then I want some advice how should I perform this initialization after exiting idle state in a proper way.

    I must say that I am not familiar with the zephyr and so far I don't like it a bit :).

    With best regards,

    Marek

          

  • Thanks for elaborating, Marek. I don't have an SSD1306 at hand at the moment, but will need to get hands of one. 

    While I try to find a display to test with, I suggest to looking through the Zephyr Community on Discord. This is probably the best place to ask about the SSD1306 and the Zephyr Power Management (PM).

    Kind regards

    Øyvind

Related