How to do connect a LCD with the SPRESENSE?



  • Hi All,

    I am trying to display a video on the LCD screen using SPRESENSE, and possibly using the camera app. To avoid reinventing the wheel, I tent to ask the following questions before diving into the spresense/nuttxkernel code etc:

    Is there a connection diagram to easily connect the LCD with the SPRESENSE? I know the display device will vary from one to another but I am looking for ili9340 and lpm013m091 based displays. A simple connection diagram would help a lot.

    How to enable the driver support for the LCD in the nuttx kernel? What is the main config parameter for the LCD?

    Do I need any changes in the camera app to get the video going?

    I am attaching the lcd display I have got here, just a s a reference.

    Any help would be highly appreciated.

    Thanks and regards,
    Vivek

    LCD.jpg


  • DeveloperWorld

    Hi @vivekbhadra

    After a quick search I found your display: tft-320x240px-mi0283qt-9a-v1.3-datasheet.pdf
    And I think you're lucky since if you look at the data sheet, you can see that they have been nice enough to expose the IM0-3 on the break-out board.
    On page 11 you can see that if you connect the IM[ x] pins correct you will be able to configure the display to run in SPI, 8 bit mode which is the preferred way.

    Here is one schematic on how to connect a ILI9340 display to the Spresense main board:
    https://hackster.imgix.net/uploads/attachments/805919/asset_14_nbycdVt8Gd.png?auto=compress%2Cformat&w=740&h=555&fit=max

    In the Spresense SDK you will find drivers for the ILI9340 display and also where it is connected, to main board or extension board.
    The following example shows camera image on a display:

                                                                                [*] Camera example                                                                                                                                  
                                                                                 (100) Camera task priority (NEW)                                                                                                                   
                                                                                 (2048) Camera stack size (NEW)                                                                                                                     
                                                                                 [*]   Output LCD 
    
    

    This should be enough to get you going for a while.
    Good luck!

    BR
    Karl



  • Thanks a lot @TE-KarlKomierowski for the help as usual. I will soon start on that and update how that goes. Cheers



  • Just so that it may help someone in future, I configured the camera app with the below to command for using with the lcd:

    tools/config.py board/spresense device/lcd examples/camera
    

    plus the above menuconfig mentioned by Karl.



  • I have hit one more issue here. I am trying to make the video camera app to be independently running on power rather than being invoked from the nsh console. So I made changes in the nuttx/.config as below:

    CONFIG_USER_ENTRYPOINT="sdk_entry"
    changed to
    CONFIG_USER_ENTRYPOINT="camera_main"

    I knew one issue which is in independent app mode the sd card is not detected if I do not put a delay after initializing the hardware. This fix works.

    But I just realized in the independent camera mode the lcd hw is not getting initialized, has anyone seen this issue before?

    Thanks and regards,
    Vivek


  • DeveloperWorld

    Hi @vivekbhadra

    You probably have to add this lines of code to camera_main do the proper initialization first:

    (void)boardctl(BOARDIOC_INIT, 0);
    

    @vivekbhadra said in How to do connect a LCD with the SPRESENSE?:

    I have hit one more issue here. I am trying to make the video camera app to be independently running on power rather than being invoked from the nsh console. So I made changes in the nuttx/.config as below:

    CONFIG_USER_ENTRYPOINT="sdk_entry"
    changed to
    CONFIG_USER_ENTRYPOINT="camera_main"

    I knew one issue which is in independent app mode the sd card is not detected if I do not put a delay after initializing the hardware. This fix works.

    But I just realized in the independent camera mode the lcd hw is not getting initialized, has anyone seen this issue before?

    Thanks and regards,
    Vivek



  • Hi @TE-KarlKomierowski thank for the reply. Yes that's the bit I missed. It's working now.