SHARP Memory Display Breakout - 2.7" 400x240 with nrf52840

Hi,

I want to use SHARP Memory Display Breakout - 2.7" 400x240 with nrf52840 development kit. I have to interface the lvgl library for the graphics development but from the documentation, I could not figure out how to connect and there is no basic code for interfacing with the nordic SDK. Please suggest any type of reference for examples if available.

Any kind of input or help will be appreciated.

Thanks in Advance,

Parents
  • Muhammad said:
    Can you guide how I can find which pins are configured for the spi in a specific project?

    After building your project, in the nRF Connect tab, you may expand GPIO to the left in VS Code. However, using the code I uploaded, I was not able to see all pins shown in use as expected. I am assuming this has to do with some of the pins configured using the new Pin control functionality and some pins defined the classic way. I will look into this and get back to you.

Reply
  • Muhammad said:
    Can you guide how I can find which pins are configured for the spi in a specific project?

    After building your project, in the nRF Connect tab, you may expand GPIO to the left in VS Code. However, using the code I uploaded, I was not able to see all pins shown in use as expected. I am assuming this has to do with some of the pins configured using the new Pin control functionality and some pins defined the classic way. I will look into this and get back to you.

Children
  • Hi,

    Thanks for the reply. I have tried with the latest nrfConnect SDK and the following is the error when I open the sample application from the nrfConnect SDK and not a single change. It seems the sample is not compiling fine here.

  • Hi Muhammad,

    At least your output shows that you are now compiling with nRF Connect SDK v2.1.0.

    In the .overlay I provided I accidentally entered default two times(or was it sleep two times). This should be corrected so that the pins are defined for both sleep and default:

    	spi3_default: spi3_default {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
    				<NRF_PSEL(SPIM_MISO, 1, 14)>,
    				<NRF_PSEL(SPIM_MOSI, 1, 13)>;
    		};
    	};
    
    	spi3_sleep: spi3_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
    				<NRF_PSEL(SPIM_MISO, 1, 14)>,
    				<NRF_PSEL(SPIM_MOSI, 1, 13)>;
    			low-power-enable;
    		};
    	};

    Hopefully, you should now be able to compile the project.

    I have not confirmed whether the overlay will work. It probably only configures the part covered by Pin Control correctly. Some work is needed in order to get the rest of the pins work correctly. I will get back to you over the weekend.

  • Hi,

    Thanks for the information. I have compiled the sample you provided successfully and I have found some results which I want to share as these are not satisfactory at this moment but I think we are now close.

    The pin mapping on the DK was showing following data on the IDE

    Then I have made changes in the spi pin number based on the above the spi3 has 0.14 and 0.15 pins for miso and sck.
    The edited code shown below.

    	spi3_default: &spi3_default {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 15)>,
    				<NRF_PSEL(SPIM_MISO, 0, 14)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 13)>;
    		};
    	};
    
    	spi3_sleep: &spi3_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 15)>,
    				<NRF_PSEL(SPIM_MISO, 0, 14)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 13)>;
    			low-power-enable;
    		};
    	};

    After that, I found the following results on the screen.

    As you can see some number is also shown on the screen and that was updated with time.

    Also, I have connected the rest of the pins as you suggested above. Are there any changes in the pin number which we should make to get a good response?

    What are your suggestions at this stage?

    Do we need to make any changes at this section of the code for the pins to be changed as maybe from the pin mapping picture above you can see pins that are under use and which are free.

        arduino_spi: &spi3 {
            compatible = "nordic,nrf-spim";
            status = "okay";
            cs-gpios = <&arduino_header 16 GPIO_ACTIVE_HIGH>; /* D10 */
            //pinctrl-0 = < &spi3_default >;
            //pinctrl-1 = < &spi3_sleep >;
            //pinctrl-names = "default", "sleep";
        
            ls0xx: ls0xx@0 {
                compatible = "sharp,ls0xx";
                label = "LS0XX";
                spi-max-frequency = <2000000>;
                reg = <0>;
                width = <400>;
                height = <240>;
                extcomin-gpios = <&arduino_header 14 GPIO_ACTIVE_HIGH>; /* D8 */
                extcomin-frequency = <60>; /* required if extcomin-gpios is defined */
                disp-en-gpios = <&arduino_header 12 GPIO_ACTIVE_HIGH>; /* D6 */
            };
        };

    Thanks for all the support.

  • Thank you for the update and photos. It looks like you are getting closer.

    Could you please upload the project files that caused the output seen in the images?

  • Hi,

    Yes, it is your sample as you shared above, I think there were minute changes, I am sharing the version which caused the above output.

    Thanks,

    lvgl_sharp_20221011.zip

Related