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

GFX example very slow - nRF52840

I am working on a new design and i am using ST7789 (240 X 320 pixels) screen with nRF52840, it is working fine. I have followed the code provided in SDK example (big thanks).

But it is painfully slow, is there a way to make it faster considering nRF52840 has a powerful processor and good memory.

Any guidance will be much appreciated. Due to cost and complexity i wanted not to use a secondary processor.

Parents
  • Hi

    The nrfx_spim example uses the extended features of SPI. Can you try to enable NRFX_SPIM_EXTENDED_ENABLED in the sdk_config.h file and set the frequency to spi_config.frequency = NRF_SPIM_FREQ_32M;

    Keep in mind that you need to use SPIM instance 3 (SPIM3) in order to support the 16 or 32 MHz frequencies. 

    Best regards,

    Simon

  • Hi Simonr,

    I tried by updating code as shown below, but after updating it stopped working. What is it that i am doing wrong?

    -->ST7789.c

    ---------------------------------

    #include "nrfx_spim.h"

    #define SPI_INSTANCE 3
    static const nrfx_spim_t spi = NRFX_SPIM_INSTANCE(SPI_INSTANCE);

    //static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(ST7735_SPI_INSTANCE);

    static ret_code_t hardware_init(void)
    {
    ret_code_t err_code;

    nrf_gpio_cfg_output(ST7789_DC_PIN);

    nrfx_spim_config_t spi_config = NRFX_SPIM_DEFAULT_CONFIG;
    spi_config.frequency = NRF_SPIM_FREQ_32M;
    spi_config.ss_pin = ST7789_SS_PIN;
    spi_config.miso_pin = ST7789_MISO_PIN;
    spi_config.mosi_pin = ST7789_MOSI_PIN;
    spi_config.sck_pin = ST7789_SCK_PIN;
    //spi_config.dcx_pin = NRFX_SPIM_DCX_PIN;
    spi_config.use_hw_ss = true;
    spi_config.ss_active_high = false;
    APP_ERROR_CHECK(nrfx_spim_init(&spi, &spi_config, NULL, NULL));
    return err_code;
    }

    -->pca10056\blank\config\sdk_config.h

    ---------------------------------

    #ifndef NRFX_SPIM3_ENABLED
    #define NRFX_SPIM3_ENABLED 1
    #endif

    #ifndef NRFX_SPIM_EXTENDED_ENABLED
    #define NRFX_SPIM_EXTENDED_ENABLED 1
    #endif

Reply
  • Hi Simonr,

    I tried by updating code as shown below, but after updating it stopped working. What is it that i am doing wrong?

    -->ST7789.c

    ---------------------------------

    #include "nrfx_spim.h"

    #define SPI_INSTANCE 3
    static const nrfx_spim_t spi = NRFX_SPIM_INSTANCE(SPI_INSTANCE);

    //static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(ST7735_SPI_INSTANCE);

    static ret_code_t hardware_init(void)
    {
    ret_code_t err_code;

    nrf_gpio_cfg_output(ST7789_DC_PIN);

    nrfx_spim_config_t spi_config = NRFX_SPIM_DEFAULT_CONFIG;
    spi_config.frequency = NRF_SPIM_FREQ_32M;
    spi_config.ss_pin = ST7789_SS_PIN;
    spi_config.miso_pin = ST7789_MISO_PIN;
    spi_config.mosi_pin = ST7789_MOSI_PIN;
    spi_config.sck_pin = ST7789_SCK_PIN;
    //spi_config.dcx_pin = NRFX_SPIM_DCX_PIN;
    spi_config.use_hw_ss = true;
    spi_config.ss_active_high = false;
    APP_ERROR_CHECK(nrfx_spim_init(&spi, &spi_config, NULL, NULL));
    return err_code;
    }

    -->pca10056\blank\config\sdk_config.h

    ---------------------------------

    #ifndef NRFX_SPIM3_ENABLED
    #define NRFX_SPIM3_ENABLED 1
    #endif

    #ifndef NRFX_SPIM_EXTENDED_ENABLED
    #define NRFX_SPIM_EXTENDED_ENABLED 1
    #endif

Children
No Data
Related