Raspberry Pi Pico LCD Shields

This is a collection of very versatile displays due to its different resolutions and sizes, the RGB capabilities and additional buttons and joystick. Nearly all displays comes with a special LCD controller wired over SPI up to the Raspberry Pi Pico. Additional momentary push buttons or joysticks are wired up over simple GPIO lines. Some shield provide also a TF/SD-card slot, wired over a second dedicated SPI bus.

Supported Shields

Hardware

The Waveshare Pico LCD 1.14 [1] shield comes with the built-in controller ST7789VW [14] inside the LCD, which is an LCD controller with 240 × RGB × 320 pixels, while the pixels of this LCD itself is 135 (H) RGB × 240 (V). There are two types of horizontal and vertical screens, so the internal RAM of the LCD is not fully used. The LCD supports 12-bit, 16-bit, and 18-bit input color formats per pixel, namely RGB444, RGB565, and RGB666 three color formats. This integration uses the RGB565 color format, which is also a commonly used RGB format. The LCD uses a four-wire SPI communication interface.

Features and Resources

Printed Circuit Board

5V/40㎃

A B UP|DOWN|LEFT|RIGHT|ENTER LCD

12 1 1

  • 1 serial 240×135 IPS 65K LCD

  • 1 LCD Backglight LED

  • 1 User joystick (5 keys)

  • 2 User keys

  • 1 RST signal to LCD controller

  • 1 C/D signal to LCD controller

  • 1 VEN signal to voltage regulator

Design Data

Waveshare Pico LCD 1.14

Positions

Waveshare Pico LCD 1.14 details

Inputs:

  1. User joystick
    UP, DOWN, LEFT, RIGHT, ENTER
  2. User keys
    momentary push buttons

Outputs:

  1. ST7789V
    1.14-inch 240×135 pixels 65K colorful IPS LCD
  2. RT9193-33
    300㎃ low dropout, low noise, ultra-fast LDO

Data Sheets

Pinouts

Pin Mapping

Pinout

on-edge(1-40):

12 1 1

on-shield:

2 BUTTON 1 CURSOR 1 BL 1 LCD

Default Zephyr Peripheral Mapping

 

  • 1 PIO/PWM : GP0 (PWM0)
  • 2 PIO/PWM : GP1 (PWM1)
  • 3 GND
  • 4 UP : GP2 (PWM2)
  • 5 ENTER : GP3 (PWM3)
  • 6 PIO/PWM : GP4 (PWM4)
  • 7 PIO/PWM : GP5 (PWM5)
  • 8 GND
  • 9 PIO/PWM : GP6 (PWM6)
  • 10 PIO/PWM : GP7 (PWM7)
  • 11 PIO/PWM : GP8 (PWM8)
    nc on-shield LCD data/cmd LCD_DC
  • 12 SPI1_CSN : GP9 (PWM9)
    nc on-shield LCD chip select LCD_CS
  • 13 GND
  • 14 SPI1_SCK : GP10 (PWM10)
    nc on-shield LCD i/f clock LCD_CLK
  • 15 SPI1_TX : GP11 (PWM11)
    nc on-shield LCD i/f data LCD_DIN
  • 16 PIO/PWM : GP12 (PWM12)
    nc on-shield LCD reset LCD_RST
  • 17 PIO/PWM : GP13 PWM13
    nc on-shield LCD backlight LCD_BL
  • 18 GND
  • 19 PIO/PWM : GP14 (PWM14)
    nc on-shield LDO power enable
    nc (optional) VCC_EN
  • 20 A : GP15 (PWM15)
  • 21 LEFT : GP16 (PWM0)
  • 22 B : GP17 (PWM1)
  • 23 GND
  • 24 DOWN : GP18 (PWM2)
  • 25 PIO/PWM : GP19 (PWM3)
  • 26 RIGHT : GP20 (PWM4)
  • 27 PIO/PWM : GP21 (PWM5)
  • 28 GND
  • 29 PIO/PWM : GP22 (PWM6)
  • 30 RUN (RESET)
  • nc PIO/PWM : GP23 (PWM7)
  • nc PIO/PWM : GP24 (PWM8)
  • nc PIO/PWM : GP25 (PWM9)
  • 31 ADC_CH0 : GP26 (PWM10)
  • 32 ADC_CH1 : GP27 (PWM11)
  • 33 GND
  • 34 ADC_CH2 : GP28 (PWM12)
  • nc ADC_CH3 : GP29 (PWM13)
  • 35 ADC_VREF
  • 36 3V3(OUT)
  • 37 3V3_EN
    nc on-shield LDO power enable
    nc (optional) VCC_EN
  • 38 GND
  • 39 VSYS
    nc on-shield LDO power enable
    nc (default) VCC_EN
  • 40 VBUS

Devicetree compatible

Waveshare Pico LCD 1.14 edge pinout

Utilization

This shields can be used with any development board, shield, or snippet that provides a Devicetree node with the raspberrypi,pico-header-r3 property for the compatibility. In particular, the SPI1 bus and some GPIO signals on pins 11 to 19 (20) of this edge connector must be free for communication with the LCD on the shields. The shields also provide the special Devicetree labels &rpipico_spi_lcd and &lcd_panel for this purpose.

For shields with touchscreen support, the GPIO signals on pins 21 and 22 of the edge connector must also be free for communication with the touchscreen controller on the shield. The shields also provide the special Devicetree labels &rpipico_spi_tsc and &tsc_panel for this purpose.

For shields with TF/microSD card slot, the GPIO signal on pin 29 of the edge connector must also be free for communication with the card on the shield over SDHC/SPI. The shields also provide the special Devicetree labels &rpipico_spi_sdc and &sdhc_spi for this purpose. In case of the SDHC/SDIO mode the GPIO signals on pins 7 and 24 to 29 must be free for communication with the card over a 4-bit SDHC/SDIO interface. But this is not yet supported and may need changes on the shield hardware.

Programming

Set -DSHIELD=waveshare_pico_lcd_1_14 and use optional the USB Console Snippet (usb-console) when you invoke west build. For example:

Using west:

west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_lcd_1_14-helloshell bridle/samples/helloshell -- -DSHIELD="waveshare_pico_lcd_1_14"
west flash -r uf2 -d build/waveshare_pico_lcd_1_14-helloshell

Using CMake and ninja:

# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_lcd_1_14-helloshell -GNinja -DBOARD=rpi_pico -DSHIELD="waveshare_pico_lcd_1_14" bridle/samples/helloshell

# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_lcd_1_14-helloshell flash

Simple test execution on target

(text in bold is a command input)

uart:~$ hello -h
hello - say hello
uart:~$ hello
Hello from shell.

uart:~$ hwinfo devid
Length: 8
ID: 0x8c998be1de969148

uart:~$ kernel version
Zephyr version 3.6.0

uart:~$ bridle version
Bridle version 3.6.1

uart:~$ bridle version long
Bridle version 3.6.1.0

uart:~$ bridle info
Zephyr: 3.6.0
Bridle: 3.6.1

uart:~$ device list
devices:
- clock-controller@40008000 (READY)
- reset-controller@4000c000 (READY)
- snippet_cdc_acm_console_uart (READY)
- uart@40034000 (READY)
- timer@40054000 (READY)
- gpio@40014000 (READY)
- adc@4004c000 (READY)
- flash-controller@18000000 (READY)
- i2c@40044000 (READY)
- vreg@40064000 (READY)
- lcd-backlight-en (READY)
- leds (READY)

uart:~$ history
[  0] history
[  1] device list
[  2] bridle info
[  3] bridle version long
[  4] bridle version
[  5] kernel version
[  6] hwinfo devid
[  7] hello
[  8] hello -h

More Samples

Input dump

Prints all input events as defined by the shields Devicetree. See also Zephyr sample: Input dump.

Print the input events related to the five on-shield joystick keys and two user keys using the Input subsystem API. That are:

A : zephyr,code = <INPUT_KEY_0>;
B : zephyr,code = <INPUT_KEY_1>;
UP : zephyr,code = <INPUT_KEY_UP>;
DOWN : zephyr,code = <INPUT_KEY_DOWN>;
LEFT : zephyr,code = <INPUT_KEY_LEFT>;
RIGHT : zephyr,code = <INPUT_KEY_RIGHT>;
ENTER : zephyr,code = <INPUT_KEY_ENTER>;
west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_lcd_1_14-input_dump zephyr/samples/subsys/input/input_dump -- -DSHIELD="waveshare_pico_lcd_1_14"
west flash -r uf2 -d build/waveshare_pico_lcd_1_14-input_dump

Simple logging output on target

***** delaying boot 4000ms (per build configuration) *****
W: BUS RESET
W: BUS RESET
*** Booting Zephyr OS … … … (delayed boot 4000ms) ***
Input sample started
I: input event: dev=gpio_keys        SYN type= 1 code= 11 value=1
I: input event: dev=gpio_keys        SYN type= 1 code= 11 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=  2 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=  2 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=103 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=103 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=108 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=108 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=105 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=105 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=106 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=106 value=0
I: input event: dev=gpio_keys        SYN type= 1 code= 28 value=1
I: input event: dev=gpio_keys        SYN type= 1 code= 28 value=0

LCD Orientation and Bit Order Test

Draw some basic rectangles onto the display. The rectangle colors and positions are chosen so that you can check the orientation of the LCD and correct RGB bit order. See also Zephyr sample: Display.

Using the Display driver API with chosen display. That is:

LCD : chosen { zephyr,display = &lcd_panel; };
ST7789V : lcd_panel: &st7789v_240x135 {};
west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_lcd_1_14-display_test zephyr/samples/drivers/display -- -DSHIELD="waveshare_pico_lcd_1_14"
west flash -r uf2 -d build/waveshare_pico_lcd_1_14-display_test

Simple logging output on target

***** delaying boot 4000ms (per build configuration) *****
[00:00:00.415,000] <wrn> udc_rpi: BUS RESET
[00:00:00.495,000] <wrn> udc_rpi: BUS RESET
*** Booting Zephyr OS … … … (delayed boot 4000ms) ***
[00:00:04.151,000] <inf> sample: Display sample for st7789v@0

LVGL Basic Sample

Displays “Hello World!” in the center of the screen and a counter at the bottom which increments every second. See also Zephyr sample: LVGL basic sample.

Using the LVGL module on top of the Display driver API with chosen display. That is:

LCD : chosen { zephyr,display = &lcd_panel; };
ST7789V : lcd_panel: &st7789v_240x135 {};

Devicetree compatible

  • zephyr,lvgl-button-input with devicetree relation lvgl_buttons: lvgl-buttons { input = <&gpio_keys>; };

    B : input-codes = <INPUT_KEY_1>; : coordinates = <120 68>; (center of LCD)
  • zephyr,lvgl-keypad-input with devicetree relation lvgl_keypad: lvgl-keypad { input = <&gpio_keys>; };

    UP : input-codes = <INPUT_KEY_UP>; : lvgl-codes = <LV_KEY_UP>;
    DOWN : input-codes = <INPUT_KEY_DOWN>; : lvgl-codes = <LV_KEY_DOWN>;
    LEFT : input-codes = <INPUT_KEY_LEFT>; : lvgl-codes = <LV_KEY_LEFT>;
    RIGHT : input-codes = <INPUT_KEY_RIGHT>; : lvgl-codes = <LV_KEY_RIGHT>;
    ENTER : input-codes = <INPUT_KEY_ENTER>; : lvgl-codes = <LV_KEY_ENTER>;
west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_lcd_1_14-lvgl_basic zephyr/samples/subsys/display/lvgl -- -DSHIELD="waveshare_pico_lcd_1_14"
west flash -r uf2 -d build/waveshare_pico_lcd_1_14-lvgl_basic

Simple test execution on target

***** delaying boot 4000ms (per build configuration) *****
[00:00:00.321,000] <wrn> udc_rpi: BUS RESET
[00:00:00.401,000] <wrn> udc_rpi: BUS RESET
*** Booting Zephyr OS … … … (delayed boot 4000ms) ***
uart:~$ _

uart:~$ lvgl stats memory
Heap at 0x20001410 contains 2047 units in 11 buckets

  bucket#    min units        total      largest      largest
             threshold       chunks      (units)      (bytes)
  -----------------------------------------------------------
        0            1            2            1            4
        1            2            1            2           12
        6           64            1           81          644
       10         1024            1         1354        10828

11492 free bytes, 4384 allocated bytes, overhead = 504 bytes (3.1%)

TF/microSD Demonstration

This samples and test applications are only applicable on the Waveshare Pico ResTouch LCD 3.5 board. They will be built with activated USB-CDC/ACM console.

Hint

The Waveshare Pico LCD 1.14 doesn’t provide a TF/microSD card slot. This samples are not applicable.

References