DEV Community

LCD Kingcai (Kingcai LCD)
LCD Kingcai (Kingcai LCD)

Posted on

7-Inch 2-Lane MIPI LCD Display 1024x600: ESP32-P4 Bring-Up, With Key Code

Many engineers looking for a 2-lane MIPI display are not short of screens. They are short of a piece of code that actually runs. The screen arrives, you connect it to an ESP32-P4, and you get a black screen, a flickering screen, or swapped colors, and you do not know if it is the wiring, the timing, or the initialization sequence.

This post is about one screen that does light up: a 7-inch MIPI LCD display, 1024x600, 2-lane MIPI DSI, with capacitive touch. A short video of it running on an ESP32 board is here: https://www.youtube.com/watch?v=Uge8-mNADHE

The screen

  • Size: 7.0 inch
  • Resolution: 1024x600
  • Type: a-Si TFT, IPS, all viewing angles
  • Interface: MIPI 2 Lane or 4 Lane
  • Touch: capacitive, G+G
  • Outline: 164.90 x 100.00 x 3.5 mm
  • Active area: 154.21 x 85.92 mm
  • Operating temperature: -20 to 70 C
  • Storage temperature: -30 to 80 C

Do not put any brightness number in the article. The product page itself disagrees on brightness, so leave it out.

Why ESP32-P4 can drive it directly

The ESP32-P4 MIPI DSI has two hard limits. It supports Video mode only, not Command mode. And it supports at most 2 lanes. This 7-inch screen fits both: it is a Video-mode receiver, and its interface can be configured as 2 lanes, so no adapter board is needed.

Bandwidth is also comfortable. At 60 Hz, 1024x600 needs about 570 Mbps in RGB565 and about 854 Mbps in RGB888, inside the ESP32-P4 recommended 480 to 1500 Mbps per lane.

Key code

This is the key configuration for 7-inch 1024x600, adapted from the longer ESP32-P4 guide on the manufacturer's site. The full initialization sequence depends on the actual driver IC, so do not copy another screen's init sequence verbatim.

#define LCD_H_RES        1024
#define LCD_V_RES        600
#define LCD_BIT_PER_PIXEL 16
#define LCD_DSI_LANE_NUM          2
#define LCD_DSI_LANE_BITRATE_MBPS 800.0f
#define LCD_MIPI_PHY_LDO_CHAN 3
#define LCD_MIPI_PHY_LDO_MV    2500
Enter fullscreen mode Exit fullscreen mode

Bring-up order: 1) enable the DSI PHY power, LDO channel 3 at 2500 mV; 2) create the MIPI DSI bus with 2 lanes; 3) create the DSI panel IO and wrap it as a DPI panel; 4) reset the screen, send the factory init sequence, turn the display on; 5) turn on the backlight; 6) allocate the frame buffer in PSRAM and register LVGL and touch.

If it does not light up

  • Black screen, backlight on: check the DSI PHY LDO, the lane rate, the init sequence, and the reset timing.
  • Flickering or garbled display: check the DPI timing, whether D0 and D1 are swapped, and the FPC contact.
  • Swapped colors: check the pixel format, RGB565 versus RGB888, and the RGB order.
  • Program stuck: DSI waits for a frame ACK by default, so check the wiring and init first.

The product is the 7 inch MIPI LCD display from Hongcai Technology. The full ESP32-P4 guide is on the manufacturer's blog: https://www.lcdhc.com/esp32-2-lane-mipi-lcd-7-1024x600.html

Top comments (0)