Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 Reporting to Arduino LCD shield?

Hi there!

Working with the nRF52840 DK, I am wondering how I might modify an existing SDK example in order to display the Tx and Rx Power characteristic on a hardware connected LCD display?

That is, rather than using a BLE-UART example, I'd like to interface with an Arduino (or others?) LCD shield mounted on the DK. 

I'v tried a few things that I thought might produce a quick result, but I find that I don't really know what I'm looking for as far the software. 

My next theory is maybe to somehow report this characteristic to the LCD over the TWI/I2C bus? But again, still a little lost on that. 

I've been using the most current SDK and Soft Device. I've been successfully using Keil to build and flash other, simpler modified example code (and Soft Device) to the DK, but the TWI is getting tricky for me. 

Open to other suggestions on how to achieve this. 

Beyond the Tx/Rx Signal, eventually I'll be looking to report the power consumption and battery level on the LCD as well. 

Many thanks for your time, 

Cheers, 

Sam

  • What you can do, on the nRF side, you can try to analyze the SPI pins using a logic analyzer to see whether the data is actually coming out from the nRF. Another thing you can check is what SPI mode you screen use. If you look in the hardware_init() function, which sets up the spi:

        nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    
        spi_config.sck_pin  = ILI9341_SCK_PIN;
        spi_config.miso_pin = ILI9341_MISO_PIN;
        spi_config.mosi_pin = ILI9341_MOSI_PIN;
        spi_config.ss_pin   = ILI9341_SS_PIN;
    
        err_code = nrf_drv_spi_init(&spi, &spi_config, NULL, NULL);
        return err_code;

    The NRF_DRVI_SPI_DEFAULT_CONFIG uses NRF_DRV_SPI_MODE_0. Try to set:

    spi_config.mode = NRF_DRV_SPI_MODE_1 to NRF_DRV_SPI_MODE_3, and see if that makes any difference. 

    And for each mode, try to connect DC to both GND and VDD.

    BR,

    Edvin

Related