Pico Eval Board

From Waveshare Wiki
Jump to: navigation, search
Pico Eval Board
Pico Eval Board

1.8inch LCD Display Module for Raspberry Pi Pico, 65K Colors, 160×128, SPI
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Primary Attribute
Category:
{{{userDefinedInfo}}}: {{{userdefinedvalue}}}
Brand: Waveshare
Website
International: Waveshare website
Chinese: 官方中文站点
Onboard Interfaces
Related Products

Overview

The Pico-Eval-Board is an overall evaluation solution designed for Raspberry Pi Pico. With 3.5inch 65K colorful LCD display and misc helpful onboard components, this evaluation board allows you to try almost every on-chip peripheral of the RP2040, eliminating the messy wiring. It is an ideal choice for users to fast get started with the Raspberry Pi Pico, as well as the RP2040 chip.

Features

  • Standard Raspberry Pi Pico header supports Raspberry Pi Pico series boards
  • 3.5inch resistive touch screen, 65K colorful, bringing clear and vivid display effect
  • Standard 3.5mm audio jack, for headphones or other audio peripherals
  • Micro SD card slot through the SDIO interface, faster access speed than SPI interface
  • Integrates battery header and recharge circuit, allows it to keep running without wired power supply
  • Other rich resources like a buzzer, photoresistor, and RGB LED...

Specifications

Operating voltage: 5V

  • Touch Type: Resistive
  • Communication bus: SPI
  • Display panel: IPS
  • Controller: ILI9488/XPT2046
  • Resolution: 480×320 Pixels
  • Display colors: 65K colorful
  • Pixel size: 0.153 × 0.153 mm
  • Display size: 73.44 × 48.96 mm
  • Dimensions: 86.00 × 57.20 mm

What's on board

Pico-Eval-Board-details-intro.jpg

  1. Rapsberry Pi Pico header
    for direct attaching to Raspberry Pi Pico
  2. LCD connector
    for connecting the 3.5inch IPS LCD
  3. Mirco USB connector
    CP2102 communication or battery recharge
  4. 3.5mm audio jack
    headphone interface
  5. Micro SD card slot
    using SDIO interface, faster access speed
  6. PH2.0 battery header
    for connecting 3.7V Li-po battery
  7. CP2102
    USB to UART converter
  8. SP0503
    diode for protecting the chip from ESD
  9. PCM5101A
    stereo audio DAC chip supports analog audio output
  10. 74HC4040
    counter chip for clock frequency division
  11. 74HC04D
    inverter chip
  12. 74HC4094
    serial to parallel data converter
  13. ETA6096
    battery recharger, 1A recharging current
  14. ICM20948
    9-axis motion sensor, allows posture sensing
  15. LSD0204
    voltage level translator, ensuring safe communication between chips on different operating voltage
  16. XPT2046
    resistive touch controller
  17. W2812B
    RGB LED, so cool
  18. Passive buzzer
    controllable sound frequency
  19. User key
    a user-defined key, connects to GP2
  20. Reset key
    Pico reset
  21. Photoresistor
    converting light intensity to voltage signal, measuring light intensity
  22. Indicators
    PWR: power indicator
    TXD: CP2102 UART TX
    RXD: CP2102 UART RX

Pinout

Pico-Eval-Board-details-inter.jpg

Hardware connection

Please take care of the direction when you connect Pico accroding to the USB port. You can also check the pin of Pico and the Eval board when connecting.
You can connect display according to the table.

Eval Board Pico Description
VCC VSYS Power Input
GND GND GND
SDIO_CLK GP5 SCK pin of SDIO interface,
LCD_DC GP8 Data/Command control pin (High: Data; Low: Command)
LCD_CS GP9 LCD select pin, low active
LCD_CLK GP10 CLK pin of the SPI
MOSI GP11 MOSI pin of SPI
MISO GP12 MISO pin of SPI
LCD_BL GP13 Backlight control
LCD_RST GP15 LCD reset pin, low active
TP_CS GP16 Touch select pin, low active
TP_IRQ GP17 Touch interrupt pin, low active
SDIO_CMD GP18 CMD pin of the SDIO interface
D0 GP19 D0 pin of the SDIO interface
D1 GP20 D1 pin of the SDIO interface
D2 GP21 D2 pin of the SDIO interface
SD_CS/D3 GP22 CS/D3 pin of the SDIO interface
Pico-Eval-Board-details-7.jpg


Setup environment

Please refer to Raspberry Pi's guide:https://www.raspberrypi.org/documentation/pico/getting-started/

Download Demo codes

Open terminal and run the following command:

wget -P ~/pico/ https://www.waveshare.net/w/upload/f/fc/Pico-ResTouch-LCD-X_X_Code.zip
cd ~/pico
unzip Pico-ResTouch-LCD-X_X_Code.zip

Run the Demo codes

This guides is based on Raspberry Pi.

C examples

  • Hold the BOOTSEL button of Pico, then connect the USB port of Pico board to Raspberry Pi and then release the button
  • Compile and run the c codes of Pico-ResTouch-LCD-X_X example
cd ~/pico/Pico-ResTouch-LCD-X_X_Code/c/build/
cmake ..
make -j4
sudo mount /dev/sda1 /mnt/pico && sudo cp main.uf2 /mnt/pico/ && sudo sync && sudo umount /mnt/pico 
  • Run the codes in Pico, then the display will work
  • You can press the RUN button of LCD for reseting pico. To enter disk mode, you can also first hold the BOOTSEL button and then the RUN button, then release the BOOTSEL button and then the RUN button without re-plug the pico

Python example

  • Update the Thonny IDE if it doesn't support Pico
  • Open the Thonny IDe and open the examples:
Pico-ResTouch-LCD-2.8 005.jpg

Codes Analysis

After running, this routine first displays some characters, patterns, and then displays pictures, and finally displays the touchpad function. C routine adaptes to PICO-RreTp=ouch-LD-2.8 and PICO-ResTouch-LD-3.5.In the main function, we place the three main functions in order and put the TP_DrawBoard(); Put in an endless loop to achieve the above functions

GUI_Show();
LCD_Show_bmp(Bmp_ScanDir , Lcd_ScanDir);	
TP_DrawBoard();

Before using LCD_SHOWBMP to display pictures, first copy the pictures in the PIC folder in the data to the SD Kagan directory, then insert the SD card into the SD card slot on the back of the screen and start downloading the program for testing

  • Note that if the SD card is in FAT format, different pixel size images are required for different screens. 2.8-inch picture pixel size is 240×320, 3.5-inch picture pixel size is 480×320, and the image should be 24-bit deep color. BMP format


The display controller used in this product is ST77899(2.8inch)/ILI9488(3.5inch). We need to initialize this controller through the SPI communication protocol. The initialization functions are written in lcd_driv.c, which can be seen in the lcd_test.c file.

 System_Init();//System initialization, configuration of serial port baud rate, SPI and related pins<br/>
  LCD_SCAN_DIR Lcd_ScanDir = SCAN_DIR_DFT; //Setting scanning mode <br/>
  LCD_Init( Lcd_ScanDir, 200);//Initializes the screen and passes the scanning mode and backlight intensity<br/>

The function function about the screen display is written in LCD_GUI.c, the function of each function and the parameters passed are explained in the source code, need to use the direct call can be

  • Draw point
void GUI_DrawPoint(POINT Xpoint, POINT Ypoint, COLOR Color,
                   DOT_PIXEL Dot_Pixel, DOT_STYLE DOT_STYLE)
  • Draw line(dotted/solid)
void GUI_DrawLine(POINT Xstart, POINT Ystart, POINT Xend, POINT Yend,
                  COLOR Color, LINE_STYLE Line_Style, DOT_PIXEL Dot_Pixel)
  • Draw rectange (empty/fulled)
void GUI_DrawRectangle(POINT Xstart, POINT Ystart, POINT Xend, POINT Yend,
                       COLOR Color, DRAW_FILL Filled, DOT_PIXEL Dot_Pixel)
  • Draw circle (empty/Fulled)
void GUI_DrawCircle(POINT X_Center, POINT Y_Center, LENGTH Radius,
                    COLOR Color, DRAW_FILL  Draw_Fill , DOT_PIXEL Dot_Pixel)
  • Display character
void GUI_DisChar(POINT Xpoint, POINT Ypoint, const char Acsii_Char,
                 sFONT* Font, COLOR Color_Background, COLOR Color_Foreground)
  • Dsiplay string
void GUI_DisString_EN(POINT Xstart, POINT Ystart, const char * pString,
                      sFONT* Font, COLOR Color_Background, COLOR Color_Foreground )
  • Display number
void GUI_DisNum(POINT Xpoint, POINT Ypoint, int32_t Nummber,
                sFONT* Font, COLOR Color_Background, COLOR Color_Foreground )
  • Display time
void GUI_Showtime(POINT Xstart, POINT Ystart, POINT Xend, POINT Yend,
                  DEV_TIME *pTime, COLOR Color)


This routine shows BMP picture first is also through the SPI protocol to read the SD card BMP format picture data, and then the data to the image display
In the lcd_test.c file, the following two functions are used primarily to display images:

SD_Init();//Intialize SD card
LCD_Show_bmp(bmp_scan_dir,lcd_scan_dir);//Display BMP picture

These functions are written in LCD_Bmp. C, and actually read the image data in BMP format from the SD card with a specific file name and call our own display function to "express" the data as an image

In LCD_Touch.c file:

  TP_Init( Lcd_ScanDir );//Touch pad initialization, pass parameters for scanning mode
  TP_GetAdFac();//Calibrate touch pad
  TP_Dialog();//Clear 
  TP_DrawBoard();//Begin the drawing board

After this routine runs, there are five colors on the right side of the screen. The system defaults to black. Touch to select a brush color. Click the AD button, click the red + sign according to the screen prompt to calibrate the screen; Click the upper right corner the CLEAR button to CLEAR the palette
The touch experiment uses four sets of calibration values by default, which can be used to handle brush operations in four directions. There are five color choices on the right, and the brush size is 9 pixels by default
The touchscreen functions are described in lcd_touch. c, and their function and the purpose of passing parameters are explained

Five fonts are provided in the codes:

   Width 5,Height 8    font8
   Width 7,Height 12    font12
   Width 11,Height 16    font16
   Width 14,Height 20    font20
   Width 17,Height24    font24


  • If you need characters of different sizes and fonts, you can use the font extraction software provided in the materials to create your own font library
  • In fact you can also Image2Lcd [1] picture modulus software to convert images of different sizes different formats to array data, then use our written function display


If you require technical support, please go to the Support page and open a tickets.