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

Connect LCD (LS013B7DH03) to nRF52840 through SPI

Hello Everyone! 

I am new to nRF boards and still in the learning phase. I want to send some data from nRF52840 to an LCD display through SPI. I am currently using the SPI example from nRF SDK and have modified it to suit my application. I am using grlib to display a string on this display and  SPI0 instance.

More details on the display can be found here: https://www.mouser.com/datasheet/2/365/LS013B7DH03%20SPEC_SMA-224806.pdf

Below is the pin configuration for SPI on nRF52840 (I have modified it in the sdk_config.h file).

SPI_MOSI --> P0.20, SPI_CLK --> P0.19, SPI_CS --> P0.24 (I am not using SPI_MISO)

I have connected these pins with the respective pins on the LCD as shown in the figure below:

When the print the output of nrf_drv_spi_transfer(), I do see the correct output in the terminal, however, I don't see anything on the screen. The screen works perfectly fine as I have checked it with Ardunio. I have tried debugging in multiple ways, but couldn't really figure out what the issue is. 

Furthermore, I have few questions: (1) Do we have to externally control the SS pin or will it be done internally? (2) What is the difference between SPI and SPIM? (3) What are the exact SPI-related configurations to be enabled (as there are plenty) in sdk_config.h file? 

I would really appreciate it if anyone could help me out. : )

Thanks and Regards,

Elsa

Parents
  • Hi Elsa

    Have you tried connecting a logic analyzer to the pins in question to check if they indeed controlled as expected? Some of the pins you refer to may used by other peripherals for instance, so please make sure that they're not. 

    Are you testing with a DK or a custom board?

    Questions:

    1. Yes. A good explanation on how you can toggle the SS pin can be seen in this case.

    2. The SPIM is a SPI master instance  with EasyDMA while the SPI is an SPI master instance without.

    3. You need to enable the peripheral you'd like to use (SPI or SPIM) as well as what instance of the you'd like to use.

    Best regards,

    Simon

Reply
  • Hi Elsa

    Have you tried connecting a logic analyzer to the pins in question to check if they indeed controlled as expected? Some of the pins you refer to may used by other peripherals for instance, so please make sure that they're not. 

    Are you testing with a DK or a custom board?

    Questions:

    1. Yes. A good explanation on how you can toggle the SS pin can be seen in this case.

    2. The SPIM is a SPI master instance  with EasyDMA while the SPI is an SPI master instance without.

    3. You need to enable the peripheral you'd like to use (SPI or SPIM) as well as what instance of the you'd like to use.

    Best regards,

    Simon

Children
No Data
Related