Skip to main content

Working with Raspberry Pi Pico

This chapter includes the following sections. Please read as needed:

Hardware Connection​

Connect the LCD module to the Raspberry Pi Pico using 8PIN wires. The pin correspondence is as follows:

LCDRaspberry Pi Pico
VCC3.3 V
GNDGND
DINGPIO19
CLKGPIO18
CSGPIO17
DCGPIO16
RSTGPIO20
BLGPIO21

MicroPython Environment Setup​

  1. Download and install the Thonny 3.3.3 installer.
  2. Press and hold the BOOTSEL button on the Raspberry Pi Pico, connect it to the computer via USB, and release the button after power-up.
  3. The computer will recognize a new disk. Download and extract the Raspberry Pi Pico MicroPython firmware, and copy the file with the .uf2 extension to that disk. After copying is complete, the Pico will automatically restart, and the disk will disappear.
  4. Open Thonny and click Python x.x.x in the lower-right corner, then select Configure interpreter.
  5. In the pop-up window, select Interpreter, set the interpreter to MicroPython (Raspberry Pi Pico), and select Auto-detect port for the port.
  6. Click the Stop button. When the MicroPython version information and the >>> prompt appear in the Shell window, the connection is successful.

The interpreter configuration is as follows:

Thonny Raspberry Pi Pico Interpreter Configuration

The Shell window after a successful connection is as follows:

Thonny Shell Window Connected to Raspberry Pi Pico

Downloading Example Programs​

Download and extract the 0.71inch LCD Module Example Programs, and open the Raspberry Pi Pico folder inside it.

Running the Example​

Before running, complete the Hardware Connection and MicroPython Environment Setup, and confirm that Thonny is connected to the Pico and the Shell window shows the >>> prompt.

  1. In Thonny, click File > Open and open Raspberry Pi Pico/gc9d01.py from the computer. Click File > Save As again, select Raspberry Pi Pico, and save it to the Pico with the original file name.

  2. Use the same method to save main.py to the root directory of the Pico. When finished, the Pico file list should contain both gc9d01.py and main.py.

    Saving gc9d01.py and main.py to the Raspberry Pi Pico

  3. Open main.py on the Pico in Thonny, and click the green run button in the toolbar or press F5 to run the current script.

    Running main.py in Thonny

  4. After the program runs, the screen displays text and color fill effects in sequence.

    Raspberry Pi Pico Driving the 0.71inch LCD Module to Display Text

    Raspberry Pi Pico Driving the 0.71inch LCD Module Color Test