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 PiMoroni Pico Display Pack (PIM543) [1] shield comes with the built-in controller ST7789 [35] inside the LCD, which is an LCD controller with 240 × RGB × 320 pixels, while the pixels of this 1.44-inch 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 X Y R G B LCD

10 4 1

  • 1 serial 1.44-inch 240×135 IPS 65K LCD

  • 1 LCD Backglight LED

  • 4 User keys

  • 3 User LEDs (TriColor ChipLED)

  • 1 RST signal to LCD controller (RUN)

  • 1 C/D signal to LCD controller

Design Data

PiMoroni Pico LCD 1.44

Positions

PiMoroni Pico LCD 1.44 details

Inputs:

  1. User keys
    momentary push buttons

 

 

 

 

Outputs:

  1. ST7789V
    1.44-inch 240×135 pixels 65K colorful IPS LCD
  2. TriColor ChipLED
    3-channel RGB 1210 (3025 metric)
  3. AP2502
    4-channel independent linear current sink,
    20㎃ on each channel, low dropout voltage

Data Sheets

Pinouts

Pin Mapping

Pinout

on-edge(1-40):

10 4 1

on-shield:

4 BUTTON 3 RGB 1 BL 1 LCD

Default Zephyr Peripheral Mapping

 

  • 1 PIO/PWM : GP0 (PWM0)
  • 2 PIO/PWM : GP1 (PWM1)
  • 3 GND
  • 4 PIO/PWM : GP2 (PWM2)
  • 5 PIO/PWM : GP3 (PWM3)
  • 6 PIO/PWM : GP4 (PWM4)
  • 7 PIO/PWM : GP5 (PWM5)
  • 8 GND
  • 9 LED_R : GP6 PWM6
  • 10 LED_G : GP7 PWM7
  • 11 LED_B : GP8 PWM8
  • 12 PIO/PWM : GP9 (PWM9)
  • 13 GND
  • 14 PIO/PWM : GP10 (PWM10)
  • 15 PIO/PWM : GP11 (PWM11)
  • 16 SW_A : GP12 (PWM12)
  • 17 SW_B : GP13 (PWM13)
  • 18 GND
  • 19 SW_X : GP14 (PWM14)
  • 20 SW_Y : GP15 (PWM15)
  • 21 PIO/PWM : GP16 (PWM0)
    nc on-shield LCD data/cmd LCD_DC
  • 22 SPI0_CSN : GP17 (PWM1)
    nc on-shield LCD chip select LCD_CS
  • 23 GND
  • 24 SPI0_SCK : GP18 (PWM2)
    nc on-shield LCD i/f clock LCD_SCLK
  • 25 SPI0_TX : GP19 (PWM3)
    nc on-shield LCD i/f data LCD_MOSI
  • 26 PIO/PWM : GP20 PWM4
    nc on-shield LCD backlight BL_EN
  • 27 PIO/PWM : GP21 (PWM5)
  • 28 GND
  • 29 PIO/PWM : GP22 (PWM6)
  • 30 RUN (RESET)
    nc on-shield LCD reset LCD_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)
    nc on-shield 3V3 power supply
  • 37 3V3_EN
  • 38 GND
  • 39 VSYS
  • 40 VBUS

Devicetree compatible

PiMoroni Pico LCD 1.44 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, one SPI bus and some GPIO signals on 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, additional GPIO signals and on occasion one I2C bus on the edge connector must also be free for communication with the touchscreen controller on the shield. Then the shields also provide the special Devicetree labels &rpipico_spi_tsc and &tsc_panel for this purpose.

For shields with TF/microSD card slot, even more GPIO signals on the edge connector must 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 up to seven additional GPIO signals 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=pimoroni_pico_lcd_1_44 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 --shield "pimoroni_pico_lcd_1_44" -d build/pimoroni_pico_lcd_1_44-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/pimoroni_pico_lcd_1_44-helloshell

Using CMake and ninja:

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

# Now run the build tool on the generated build system:
ninja -Cbuild/pimoroni_pico_lcd_1_44-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 4.1.0

uart:~$ bridle version
Bridle version 4.1.0

uart:~$ bridle version long
Bridle version 4.1.0.0

uart:~$ bridle info
Zephyr: 4.1.0
Bridle: 4.1.0
uart:~$ device list
devices:
- clock-controller@40008000 (READY)
  DT node labels: clocks
- reset-controller@4000c000 (READY)
  DT node labels: reset
- snippet_cdc_acm_console_uart (READY)
  DT node labels: snippet_cdc_acm_console_uart
- uart@40034000 (READY)
  DT node labels: uart0 pico_serial rpipico_serial
- timer@40054000 (READY)
  DT node labels: timer
- gpio@40014000 (READY)
  DT node labels: gpio0
- adc@4004c000 (READY)
  DT node labels: adc
- flash-controller@18000000 (READY)
  DT node labels: ssi
- i2c@40044000 (READY)
  DT node labels: i2c0 pico_i2c pico_i2c0 rpipico_i2c rpipico_i2c0
- pwm@40050000 (READY)
  DT node labels: pwm pico_pwm rpipico_pwm
- vreg@40064000 (READY)
  DT node labels: vreg
- rtc@4005c000 (READY)
  DT node labels: rtc
- lcd-backlight-en (READY)
  DT node labels: lcd_backlight_en
- gpio_leds (READY)
  DT node labels: gpio_leds
- 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 four on-shield user keys using the Input subsystem API. That are:

A : zephyr,code = <INPUT_KEY_A>;
B : zephyr,code = <INPUT_KEY_B>;
X : zephyr,code = <INPUT_KEY_X>;
Y : zephyr,code = <INPUT_KEY_Y>;
west build -b rpi_pico -p -S usb-console --shield "pimoroni_pico_lcd_1_44" -d build/pimoroni_pico_lcd_1_44-input_dump zephyr/samples/subsys/input/input_dump
west flash -r uf2 -d build/pimoroni_pico_lcd_1_44-input_dump

Simple logging output on target

***** delaying boot 4000ms (per build configuration) *****
W: BUS RESET
W: BUS RESET
*** Booting Zephyr OS build v4.1.0 (delayed boot 4000ms) ***
Input sample started
I: input event: dev=gpio_keys        SYN type= 1 code= 30 value=1
I: input event: dev=gpio_keys        SYN type= 1 code= 30 value=0
I: input event: dev=gpio_keys        SYN type= 1 code= 48 value=1
I: input event: dev=gpio_keys        SYN type= 1 code= 48 value=0
I: input event: dev=gpio_keys        SYN type= 1 code= 45 value=1
I: input event: dev=gpio_keys        SYN type= 1 code= 45 value=0
I: input event: dev=gpio_keys        SYN type= 1 code= 21 value=1
I: input event: dev=gpio_keys        SYN type= 1 code= 21 value=0

LED color change

Drives an RGB LED that must defined by the shields Devicetree. See also Zephyr sample: PWM RGB LED.

Iterates through the three color channels and changes the output color on the on-shield TriColor ChipLED using the PWM driver API. That are:

R : aliases { red-pwm-led = &pwm_led_r; };
G : aliases { green-pwm-led = &pwm_led_g; };
B : aliases { blue-pwm-led = &pwm_led_b; };
west build -b rpi_pico -p -S usb-console --shield "pimoroni_pico_lcd_1_44" -d build/pimoroni_pico_lcd_1_44-led_test zephyr/samples/basic/rgb_led
west flash -r uf2 -d build/pimoroni_pico_lcd_1_44-led_test

Simple logging output on target

***** delaying boot 4000ms (per build configuration) *****
W: BUS RESET
W: BUS RESET
*** Booting Zephyr OS build v4.1.0 (delayed boot 4000ms) ***
PWM-based RGB LED control

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 --shield "pimoroni_pico_lcd_1_44" -d build/pimoroni_pico_lcd_1_44-display_test zephyr/samples/drivers/display
west flash -r uf2 -d build/pimoroni_pico_lcd_1_44-display_test
Waveshare Pico LCD 1.44 Display Sample Animation

TOP LEFT, TOP RIGHT, BOTTOM RIGHT

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 build v4.1.0 (delayed boot 4000ms) ***
[00:00:04.151,000] <inf> sample: Display sample for st7789v@0

Draw touch events on LCD

Draw a small plus in the last touched coordinates. In this way, parameters such as inverted/swapped axes can be examined. See also Zephyr sample: Draw touch events.

Hint

The PiMoroni Pico LCD 1.44 doesn’t provide a touchscreen panel. This sample is not applicable.

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_B>; : coordinates = <120 68>; (center of LCD)
  • zephyr,lvgl-keypad-input with devicetree relation lvgl_keypad: lvgl-keypad { input = <&gpio_keys>; };

    Y : input-codes = <INPUT_KEY_Y>; : lvgl-codes = <LV_KEY_LEFT>;
    X : input-codes = <INPUT_KEY_X>; : lvgl-codes = <LV_KEY_RIGHT>;
    B : input-codes = <INPUT_KEY_B>; : lvgl-codes = <LV_KEY_ENTER>;
west build -b rpi_pico -p -S usb-console --shield "pimoroni_pico_lcd_1_44" -d build/pimoroni_pico_lcd_1_44-lvgl_basic zephyr/samples/subsys/display/lvgl
west flash -r uf2 -d build/pimoroni_pico_lcd_1_44-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 build v4.1.0 (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 aren’t applicable on all boards. They will be built with activated USB-CDC/ACM console.

Hint

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

References