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

Any example code for OLED sd1306 with TWI/I2C and nrf52

Hi,

Here and here are examples of a port of the nice u8glib library to stm32. Based on these, i tried a port to nrf52, but was not successful so far.

I call the oled display via its DEVICE_ADDRESS 0x78 and

ret_code = nrf_drv_twi_tx(&m_twi_master, DEVICE_ADDRESS, buffer, sizeof(buffer), true);

The oled does not send a response, so ret_code contains an error code. I not sure if this is an issue, or the initialization of the display itself is not correctly done.

Therefore, is there any example code available to get an OLED sd1306 module working over TWI/I2C with nrf52?

Yours Johannes

Parents
  • Hi monpetit,

    I tried a right shift

    addr = DEVICE_ADDRESS;
    addr >>=1;
    

    so 0x78 becomes 0x3c. And used addr instead of DEVICE_ADDRESS in the nrf_drv_tw_tx command. But ended up with a NRF_ERROR_INTERNAL. Only with the direct assignment of

    addr = 0x3c;
    

    nrf_drv_tw_tx() works without throwing an error code. Still I have not anything displayed on the oled, so I have to dig further.

    Thanks for the tip. Yours Johannes

Reply
  • Hi monpetit,

    I tried a right shift

    addr = DEVICE_ADDRESS;
    addr >>=1;
    

    so 0x78 becomes 0x3c. And used addr instead of DEVICE_ADDRESS in the nrf_drv_tw_tx command. But ended up with a NRF_ERROR_INTERNAL. Only with the direct assignment of

    addr = 0x3c;
    

    nrf_drv_tw_tx() works without throwing an error code. Still I have not anything displayed on the oled, so I have to dig further.

    Thanks for the tip. Yours Johannes

Children
No Data
Related