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 -
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=maxIn 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 -
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.
-
Hi @TE-KarlKomierowski and @vivekbhadra
I'm new to the nuttx ecosystem and was quite overwhelmed looking at the configuration, your conversation alone helped me understand a bit more about the usage of the sdk.
Thank you !I have a couple of related questions:
-
board/spresense
does not exist anymore when using tools/config.py. Is this expected ? Is the commandtools/config.py device/lcd examples/camera
sufficient for generating an example that captures image from the camera and display it on the LCD ? -
My ILI9340 display uses 3.3V Vin so I will be using the extension board since the main board I/O only supports 1.8V. I found the following configuration in the menuconfig. Is this the correct for my setup ?
- In the conversation above you suggested/used the main board directly. Was the example previously configured to use the main board ?
Cheers !
-
-
Hey, @samasen-0-1-1
The camera example already enables the LCD device, so you don't even need to write that.
tools/config.py examples/camera is enough.By default, the example uses the extension board. The picture you showed looks like the correct setup to me. Those are the pins I used last time I hooked an LCD display to my spresense board.