2.8inch DPI LCD

From Waveshare Wiki
Jump to: navigation, search
2.8inch DPI LCD
2.8inch-DPI-LCD-2.jpg

480x640, Raspberry Pi 2.8inch IPS capacitive touchscreen, DPI interface, 5-point touch
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Features

  • 2.8inch IPS optical bonding IPS capacitive touch screen, 480 x 640 hardware resolution.
  • Based on the 40pin GPIO interface of Raspberry Pi.
  • Uses the DPI666 interface of Raspberry Pi to drive LCD, refresh rate up to 60Hz.
  • Drives capacitive touch through the I2C interface of Raspberry Pi, 5-point touch, toughened glass panel, hardness up to 6H.
  • Supports Raspberry Pi/Kali systems

Working with Raspberry Pi

Hardware Connection

Please install the display screen carefully onto the Raspberry Pi's 40PIN GPIO interface as shown in the figure. 2.8inch-DPI-LCD-Manual-10.jpg 2.8inch-DPI-LCD-Manual-11.gif

Software Settings

For Raspberry Pi OS Bookworm and Bullseye Branch

Download the latest version of the image from the Raspberry Pi official website.

1. Download the compressed file to the PC, and extract it as img file.
2. Connect the TF card to the PC, format the TF card with SDFormatter software.
3. Open the Win32DiskImager software, select the system image prepared in step 1, and click Write to flash the system image.
4. After the image flashing is completed, open the config.txt file in the root directory of the TF card, add the following code at the end of the config.txt and save:
dtoverlay=vc4-kms-v3d
dtoverlay=waveshare-28dpi-3b-4b   
dtoverlay=waveshare-28dpi-3b
dtoverlay=waveshare-28dpi-4b
dtoverlay=waveshare-touch-28dpi
dtoverlay=vc4-kms-dpi-2inch8
5. Download the 2.8inch DPI LCD DTBO file and extract, then copy to the overlays directory (/boot/overlays/).
6. Save and safely eject the TF card, then insert the TF card into the Raspberry Pi.
7. Power on the Raspberry Pi, and wait for about 30 seconds and it will be displayed normally.

For Raspberry Pi OS Buster and Ubuntu System

1. Open the config.txt file in the root directory of the TF card, add the following code at the end of the config.txt, save and safely eject the TF card.
gpio=0-9=a2
gpio=12-17=a2
gpio=20-25=a2
dtoverlay=dpi24
enable_dpi_lcd=1
display_default_lcd=1
extra_transpose_buffer=2
dpi_group=2
dpi_mode=87
dpi_output_format=0x7F216
hdmi_timings=480 0 26 16 10 640 0 25 10 15 0 0 0 60 0 32000000 1
dtoverlay=waveshare-28dpi-3b-4b
dtoverlay=waveshare-28dpi-3b
dtoverlay=waveshare-28dpi-4b

Note: When using this method to drive, comment out the dtoverlay=vc4-kms-v3d/dtoverlay=vc4-fkms-v3d statements in the file.

2. Download the 2.8inch DPI LCD DTBO file and extract, then copy to the overlays directory (/boot/overlays/).
3. Save and safely eject the TF card, then insert the TF card into the Raspberry Pi.
4. Power on the Raspberry Pi, and wait for about 30 seconds and it will be displayed normally.

Display Rotation

Bookworm Display Rotation

GUI interface rotation

  • 1. Open the "Screen Configuration" application;

DSI-LCD-Bookworm-Rotate-01.png

  • 2. Go to "Screen" - > "DPI-1" - > "Touchscreen" and check "13-005 Goodix Capacitive TouchScreen";

400px-2.8 DPI LCD rotate 1.png

  • 3. Go to "Screen" -> "DPI-1" -> "Orientation", check the direction you need to rotate, and finally click "Apply" to complete the screen and touch synchronous rotation.

400px-2.8 DPI LCD rotate 2.png -->
Note: Only the Bookworm system supports the above synchronization rotation method. Note: Only the Bookworm system supports the above synchronous rotation methods. For Bullseye and Buster systems, after displaying rotation, touch rotation needs to be manually set separately.

lite version display rotation

sudo nano /boot/firmware/cmdline.txt
#Add a command to display the rotation angle at the beginning of the cmdline.txt file, and save it to take effect after restarting
#Display rotation 90 degrees
video=DPI-1:480x640M@60,rotate=90
#Display rotation 180 degrees
video=DPI-1:480x640M@60,rotate=180
#Display rotation 270 degrees
video=DPI-1:480x640M@60,rotate=270

Note: Unable to rotate DPI display and HDMI display separately using cmdline.txt. When you use both DPI and HDMI simultaneously, they share the same rotation value.

Bullseye/Buster Display Rotation

GUI interface rotation

  • 1. Open the "Screen Configuration" application;

DSI-LCD-Bullseye-Rotate-02.png

  • 2. Go to "Screen" -> "DPI-1" -> "Orientation", check the direction you need to rotate, and finally click "Apply" to complete the display rotation.

DSI-LCD-Bullseye-Rotate-03.png


lite version display rotation

  • 1. Need to modify the /boot/cmdline.txt file:
sudo nano /boot/cmdline.txt
  • 2. At the beginning of the cmdline.txt file, add the command for displaying the rotation angle: (Please note, this command needs to be on the same line, with each command separated by a space.)
video=DPI-1:480x640M@60,rotate=90

Change the display rotation angle by modifying the rotate value to 90, 180, or 270.

  • 3. Save and restart
sudo reboot

Stretch/Jessie Display Rotation

For some older systems, they do not use the vc4-kms-v3d or vc4-fkms-v3d driver modes, and the display rotation method is as follows:

  • 1. Add a statement to the config.txt file (the config file is located in the root directory of the TF card, i.e., in the /boot folder):
display_rotate=1 #1: 90; 2: 180; 3: 270
  • 2. Save the changes and then reboot the Raspberry Pi
sudo reboot

Touch Rotation

Bookworm Touch Rotation

If you use the graphical interface for rotation, you can tick "Touchscreen" in the screen layout editor window to synchronize the touch rotation. Please refer to the previous introduction for how to rotate the screen. For the command line rotation method, please refer to the following text:
1. Create a new file named 99-waveshare-touch.rules

sudo nano /etc/udev/rules.d/99-waveshare-touch.rules

2. Add the following lines as needed:

#90°:
ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 -1 1 1 0 0"

#180°:
#ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"

#270°:
#ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 1 0 -1 0 1"

3. Save and reboot

sudo reboot

Bullseye/Buster Touch Rotation

After some systems display rotation, the touch direction is inconsistent, and you need to perform the following operations to perform touch rotation:
1. Install libinput

sudo apt-get install xserver-xorg-input-libinput
  • If you have Ubuntu or Jetson Nano installed. The installation code is:
sudo apt install xserver-xorg-input-synaptics

2. Create the xorg.conf.d directory under /etc/X11 (if the directory already exists, proceed directly to step 3).

sudo mkdir /etc/X11/xorg.conf.d

3. Copy the 40-libinput-conf file to the directory you created just now.

sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/

4. Edit this file.

sudo nano /etc/X11/xorg.conf.d/40-libinput.conf
#Find the touchscreen section, add the corresponding rotation angle command in it, and save it
#"90° Right touch rotation:
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
#180° Inverted touch rotation: 
#Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
#270° Left touch rotation: 
#Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
Similar to the position in the following image:

Touch roate.jpg
5. Reboot Raspberry Pi

sudo reboot

After completing the above steps, touch will cause a rotation.

Touch Mode Selection

The Bookworm system supports two touch modes, which can be switched in the Screen Configuration > Touchscreen menu:
600px-DSI-Touch-Bookworm-Keyboard-03.png

  • 1. Mouse Emulation (default)
Click = Left mouse button function
Long press = Right mouse button function
Supports double-click
Does not support swipe page and multi-touch functions

Note: This mode is suitable for scenarios that require mouse operation, such as double clicking to open the file manager and long pressing to achieve right-click functionality.

  • 2.Multitouch
Supports multi-touch functionality
Supports swiping pages
Does not support double-click and right-click long press functions

Note: This mode is suitable for touch-optimized scenarios, such as web browsing and scrolling lists.

Use Touchscreen Virtual Keyboard

Raspberry Pi OS Bookworm and later versions include Squeekboard on-screen keyboard by default.
When connecting to the touch display, the on-screen keyboard will automatically appear if text input is possible, and it will automatically hide if text input is not possible.
For applications that do not support automatic text input detection, you can manually display or hide the on-screen keyboard by clicking the keyboard icon at the far right of the task bar.
600px-DSI-Touch-Bookworm-Keyboard-01.png
You can also permanently set the display or hide the screen keyboard through the "Display" option under "Raspberry Pi Configuration" or through the "Display" section in raspi-config.
600px-DSI-Touch-Bookworm-Keyboard-02.png

  • Note:

For versions of Raspberry Pi OS before Bookworm, use matchbox-keyboard. If you are using the wayfire desktop compositor, use wvkbd.

Disable Power Saving

If you want to keep the display turning on all the time, you can disable the power-saving function. You can disable the function by setting it up as follows.
Open lightdm.conf

sudo nano /etc/lightdm/lightdm.conf

Modify lightdm.conf Find the [SeatDefaults] option and uncomment the line "xserver-command", modify it as below:

#xserver-command=X

Modify it into:

xserver-command=X -s 0 -dpms
  • -s # –Disable the screen protection.
  • dpms Disable power saving.

Reboot.

sudo reboot

Adjust Backlight

PWM Backlight Adjustment

  • Install WiringPi
cd ~
git clone https://github.com/WiringPi/WiringPi.git
cd WiringPi
./build
gpio -v

The successful installation will output the gpio version as follows:
3.5F pwm1.png

  • Manually adjust the screen PWM backlight
gpio -g mode 18 pwm       	#Configure the PIN as PWM mode
gpio pwmc 100   		#Set PWM clock divider
gpio -g pwm 18 0         	#Darkest
gpio -g pwm 18 1023      	#Brightest
gpio -g mode 18 out             #Clear the PIN to output mode
  • Set the screen off and on

You can use the following commands to set the screen off and on.

Note: The PWM pin must be set to output to achieve this control.

sudo echo 1 | sudo tee /sys/class/backlight/rpi_backlight/bl_power
sudo echo 0 | sudo tee /sys/class/backlight/rpi_backlight/bl_power

pinctrl Backlight Adjustment

  • Set the screen on
sudo pinctrl set 18 op dh
  • Set the screen off
sudo pinctrl set 18 op dl

Pinout Definition

The pins labeled "NC" below mean that the touch screen is not using these pins, and the user can use them for other applications.

PIN NO. SYMBOL DESCRIPTION
1 NC Not Connected
2 5V Power positive (5V power supply)
3 VSYNC Vertical sync
4 5V Power positive (5V power supply)
5 HSYNC Horizontal sync
6 GND Ground
7 B2 RGB signal cable
8 G4 RGB signal cable
9 GND Ground
10 G5 RGB signal cable
11 G7 RGB signal cable
12 PWM Backlight control
13 TP_INT Touch Panel interrupt
14 GND Ground
15 R4 RGB signal cable
16 R5 RGB signal cable
17 NC Not Connected
18 R6 RGB signal cable
19 TP_SDA I2C SDA for touch panel
20 GND Ground
21 B7 RGB signal cable
22 R7 RGB signal cable
23 TP_SCL I2C SCL for touch panel
24 B6 RGB signal cable
25 GND Ground
26 B5 RGB signal cable
27 LCD_CLK LCD clock
28 DE LCD data enable
29 B3 RGB signal cable
30 GND Ground
31 B4 RGB signal cable
32 G2 RGB signal cable
33 G3 RGB signal cable
34 GND Ground
35 NC Not Connected
36 G6 RGB signal cable
37 NC Not Connected
38 R2 RGB signal cable
39 GND Ground
40 R3 RGB signal cable

Resources

Software

Diagrams

Project Resources

This section features third - party project resources. We merely provide links and bear no responsibility for content updates or maintenance. Thank you for your understanding.


This Does Not Compute - I turned a CLOCK into a vintage Mac!

FAQ

 Answer:

You can comment out the following statements in the config.txt file

dtoverlay=waveshare-touch-28dpi


 Answer:

It is not recommended to extend the DPI screen cable by more than 10 cm.

Since DPI uses parallel signals and contains a large number of high-speed data cables, transmission over longer distances is prone to signal interference, picture jitter, screen flickering, or inability to display.
If you need a connection over longer distances, it is recommended to use interface types that support differential signals, such as HDMI, MIPI DSI, or LVDS, which are better suited for long-distance transmission in terms of interference resistance and signal integrity.




Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)