2.8 inch Touch Screen for Pi zero

From Geekworm
Jump to navigation Jump to search


Version-A 2.8 inch Touch Screen for Pi zero W
Version-A 2.8 inch Touch Screen for Pi zero W
Version-A 2.8 inch Touch Screen for Pi zero W
Version-B 2.8 inch Touch Screen for Pi zero W
Version-C 2.8 inch Touch Screen for Pi zero WH
Version-C 2.8 inch Touch Screen for Pi zero WH

Overview

Fastest 2.8 inch Touchscreen for Raspberry Pi Zero /W and Raspberry pi 3 model b+ /3B/2B/B+/CM3 etc,Super HD 640x480 Resolution,60+ fps

Perfect fit your Pi zero/ zero w, PORTABLE MONITOR

Customized circuit board for 2.8-inch

High speed Raspberry Pi screen

Working Current: 100 mA

Notice: Not including Raspberry Pi zero / Pi zero W board

In fact, this screen fits to Raspberry Pi 3B/2B/B+; but you must use the bread cables to connect them, because it's male pins on the this screen, and it's male pins on the pi 3B also;

Use Guide

ZERO PIN: File:ZERO-PIN.xls

Github project: https://github.com/tianyoujian/MZDPI

Setup screen via script (Recommend)

cd ~/
git clone https://github.com/tianyoujian/MZDPI.git
cd MZDPI/vga
sudo chmod +x mzdpi-vga-autoinstall-online
sudo ./mzdpi-vga-autoinstall-online
sudo reboot

How to solve the blue/yellow on Raspberry pi 4?

Please run the following shell or refer to above github project:

sudo raspi-gpio set 8 a2
sudo raspi-gpio set 7 a2

For linux kernel 4.9 (old)

Download File:Mzdpi-vga-4.9.x.zip, and unzip it;

Copy the mzdpi.dtbo to the directory /boot/overlays, and copy the the other files to directory /boot;

then restart the raspberry pi;

Note: We only test the screen on Raspbian OS and Retropie now;

How to check the kernel version?

uname -a


For linux kernel4.4 or Earlier (old)

Which GPIO Pins are Occupied by this screen? Please refer to here: File:PI ZERO W LCD PIN.ZIP

Picture

Raspberry-Pi-Zero-Screen.jpg

For Version-B

What is the purpose of the NEW 2.8 inch display pins VBAT, AUX (with jumper), PWM and left-side pins ?

1.VBAT and AUX are the ADC inputs of the XPT2046 and can be used to measure voltage. The XPT2046 is a touch control chip.

2.The PWM pin is the control pin of the backlight. The brightness of the PMW signal can be adjusted externally.

3.The left-side pins (on New Version B photo) is no use.

New 2.8 inch screen information.jpg

FAQ of Version-B

Question: 1. How is it possible to control the backlight brightness with the pins on the back? Can I use an adjustable resistor? Do I need to solder those pins to the raspberry and use some software?

/How is it possible to turn off the screen in software on the raspberry? Is there a command? An external switch with the pins on the back? Perhaps just turning down the brightness to 0 level?

Answer:

1. Please use the short circuiter to connect the pin of PWM and GPIO 18, then can control the backlight brightness by software.

2.The Raspberry Pi GPIO 18 can output the signal of PWM.

3.When the GPIO 18 output low level (PWM duty cycle is 0), the backlight is off.

Question:

2.Is this screen is SPI? Or HDMI? 16 bit color or 24 or 32?

Answer:

The 2.8inch screen is consist of display screen and touch screen, The display screen is DPI, and the touch screen is SPI.And it is 16 bit color and RGB565 mode.

For Version-C

2.8 inch Touch Screen for Pi zero WH-Version-C.jpg

Update of the Version C:

FAQ of Version-C

Question 1:

Why the LCD cannot light up?

Answer:

(1)It is directly control via software:

sudo raspi-gpio set 18 op dh (turn on the backlight)

sudo raspi-gpio set 18 op dl (turn off the backlight)

(2)Or you could add

gpio=18=op,dh

into the config.txt. then the backlight will be turned on as soon as the system is running.

Add your comment
Geekworm welcomes all comments. If you do not want to be anonymous, register or log in. It is free.


Anonymous user #33

7 days ago
Score 0++
Not sure anyone will read this, but how do I disable the touchscreen so that I can utilize i2c for an RTC????

Anonymous user #32

one month ago
Score 0++
Can you please get this working with pi Musicbox and Volumio systems (Linux kernel v4.14.**)?

Anonymous user #31

2 months ago
Score 0++

Facing issues with version B and a raspberry pi zeor w.

Installed all the drivers. The screen is connected, and is obviously receiving power. But the screen itself just doesn't show anything, it is a black screen.

Christr

2 months ago
Score 0++

How do you rotate the touch part? I wanted to rotate display and set display_rotate=1 which works, but how do you also rotate the touch portion?

thanks

--chris

Anonymous user #28

2 months ago
Score 0++

Found my own fix.

edited: /etc/X11/xorg.conf.d/99-calibration.conf

reversed the Calibration section options a bit. Mine is now this after calibration:

Section "InputClass" Identifier "calibration" MatchProduct "ADS7846 Touchscreen" Option "Calibration" "3964 151 3843 240" Option "SwapAxes" "0"

EndSection

Anonymous user #27

3 months ago
Score 0++
I've also received MZP280V00BR model and I only get the backlight with Raspberry Pi 3B. The backlight becomes a bit brighter/dimmer during the boot time, but nothing is displayed on the screen.

JdeFalconr

3 months ago
Score 0++

Hello,

I've just connected this screen to my Pi Zero W but I get no output. The Pi boots normally but the screen's backlight just flickers intermittently and nothing displays on the screen. I went through the online setup script and rebooted afterwards, also doing an apt-get update too for good measure.

JdeFalconr

3 months ago
Score 0++
OK I was able to get the backlight to stay on (bad connection) but the screen is still empty. On which GPIO pins should I check connection to make sure that my remaining connections are good?

Anonymous user #29

2 months ago
Score 0++
@jdeFalconr: Any luck troubleshooting this issue? I'm attempting to use the MZP280V04TR V1.0 model screen with a raspberry pi zero w. I've followed the Read.me instructions for installing the device drivers. Once I 'sudo reboot' the screen backlight turns on, but there is no image displayed (i.e., no raspbian desktop). I haven't found any additional information online to help me troubleshoot this issue. Has anyone been able to get this screen working?

Anonymous user #30

2 months ago
Score 0++
I think I am having the same problem. The screen is connected, and is obviously receiving power. But the screen itself just doesn't show anything! I followed their driver instructions, and after reboots, it simply doesn't do anything beside turn on the backlight.

Gtejias

3 months ago
Score 0++
Hi.. after a lot of search over the internet, I still can't manage to solve the blue/yellow screen problem... tried any of the advices mentioned, but no one works!!! Has anyone done it NOT entering terminal to write sudo raspi.. everytime?

Christr

2 months ago
Score 0++

So the issue with the Blue/Yellow appears to be when the serial driver loads, it for some reason resets GPIO 7 & 8. So the setting that the vendor put in /boot/config.txt gets overridden.

So, I put the following mini startup script in to run on boot. Script location-name: /etc/systemd/system/fixgpio.service Script contents below:

[Unit] Description=fix gpio for screen

[Service] Type=simple ExecStart=/usr/bin/raspi-gpio set 7-8 a2

[Install] WantedBy=multi-user.target

Then run service fixgpio enable and reboot.

--Chris

Zakukashi

5 months ago
Score 0++

Hello,

I connected this screen to my PI Zero, everything works great with colors and brightness etc.. However my screen seems to have permanent black lines in a weird circle configuration. Almost looks like artefacts left from someone drawing on the screen. How can I remove this? IT seems to be always there, even when PI is booting I can see the lines "stuck".

Heres what it looks like:

https://imgur.com/a/ppxY7Al

Anonymous user #26

5 months ago
Score 0++

Hello. I have just received this screen, model B. I did all the steps that this webpage is saying, but, even with that, it is not working. The thing is that the pi zero is not even booting, the led to indicate it is off. But, magically, when I remove the screen, the pi boots without problem.

Can someone help me with this issue. Thank you!

Abby

5 months ago
Score 0++

Hi, Do you install the driver? Please refer to: https://rasp...or_Version-B

If it still not work, please kindly attach some picture to show your installation and steps, and we will reflect to our engineer.

Anonymous user #26

5 months ago
Score 0++

Thanks for your quick answer. Finally, I managed to make it work, the problem was the pi zero, it was giving only 3v to the screen. I tried with other pi zero and it works perfectly when I use raspbian.

I tried to use RetroPie (I want to create a portable console) but I don't manage to make it work, when I execute the installer I get an error saying that /boot/tmp.dts does not exist and FATAL ERROR.

Any ideas about this? Thank you and have a nice day.

Anonymous user #25

5 months ago
Score 0++
Hello. My C versión shows small vertical lines forming a circle. Can it be caused by software?

Negens

6 months ago
Score 0++

Hello,

After digging a lot, I made it. Forget the raspi-gpio program. I could never install it because of the messy buggy nodejs package.

Here is the method I used :


Create a file "gpio_alt.c" :

==========================================

/* Utility to switch Raspberry-Pi GPIO pin functions Tim Giles 01/04/2013

Usage: $ gpio_alt -p PIN_NUMBER -f ALT_NUMBER

Based on RPi code from Dom and Gert, 15-Feb-2013, <http://elinu...ipherals#C_2> and Gnu getopt() example <http://www.g...le-of-Getopt>

  • /
  1. include <ctype.h>
  2. include <stdio.h>
  3. include <stdlib.h>
  4. include <unistd.h>
  5. include <fcntl.h>
  6. include <sys/mman.h>
  1. define BCM2708_PERI_BASE 0x20000000
  2. define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO controller */
  3. define PAGE_SIZE (4*1024)
  4. define BLOCK_SIZE (4*1024)

int mem_fd; void *gpio_map; volatile unsigned *gpio; void setup_io();

// GPIO setup macros. Always use INP_GPIO(x) before using OUT_GPIO(x) or SET_GPIO_ALT(x,y)

  1. define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))
  2. define OUT_GPIO(g) *(gpio+((g)/10)) |= (1<<(((g)%10)*3))
  3. define SET_GPIO_ALT(g,a) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3))
  1. define GPIO_SET *(gpio+7) // sets bits which are 1 ignores bits which are 0
  2. define GPIO_CLR *(gpio+10) // clears bits which are 1 ignores bits which are 0


int main (int argc, char **argv) { int opt, flag, n_pin, n_alt; flag=0;

while ((opt = getopt (argc, argv, "hp:f:")) != -1) { switch (opt) { case 'h': break; case 'p': n_pin = atoi(optarg); flag |= 0b0001; break; case 'f': n_alt = atoi(optarg); flag |= 0b0010; break; case '?': // getopt() prints error messages, so don't need to repeat them here return 1; default: abort (); } }

if (flag != 0b0011) { fprintf (stderr, "Usage:\n$ gpio_alt -p PIN_NUM -f FUNC_NUM\n"); return 1; }

setup_io(); // Set up gpi pointer for direct register access INP_GPIO(n_pin); // Always use INP_GPIO(x) before using SET_GPIO_ALT(x,y) SET_GPIO_ALT(n_pin, n_alt);

printf("Set pin %i to alternative-function %i\n", n_pin, n_alt);

return 0; }


void setup_io() { /* open /dev/mem */ if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) { printf("can't open /dev/mem \n"); exit(-1); }

/* mmap GPIO */ gpio_map = mmap( NULL, //Any adddress in our space will do BLOCK_SIZE, //Map length PROT_READ|PROT_WRITE,// Enable reading & writting to mapped memory MAP_SHARED, //Shared with other processes mem_fd, //File to map GPIO_BASE //Offset to GPIO peripheral );

close(mem_fd); //No need to keep mem_fd open after mmap

if (gpio_map == MAP_FAILED) { printf("mmap error %d\n", (int)gpio_map);//errno also set! exit(-1); }

// Always use volatile pointer! gpio = (volatile unsigned *)gpio_map; }

=======================

Then run following commands to compile and copy it on PATH : gcc gpio_alt.c -o gpio_alt sudo chown root:root gpio_alt sudo chmod u+s gpio_alt sudo mv gpio_alt /usr/local/bin/


Create a systemd file /etc/systemd/system/mzdpi.service

=========================

[Unit] Description=mzdpi screen blue yellow fix service

[Service] Type=oneshot ExecStart=/usr/local/bin/gpio_alt -p 7 -f 2 ; /usr/local/bin/gpio_alt -p 8 -f 2

[Install] WantedBy=multi-user.target Alias=mzdpi.service

=========================

systemctl daemon-reload

systemctl enable mzdpi.service

Anonymous user #24

6 months ago
Score 0++
Hi, how can i get this to work with Kali Linux??

Cindy

6 months ago
Score 0++
Hi, sorry, not tested on Kali Linux.

Anonymous user #23

10 months ago
Score 0++
Is there any way i can just use the a couple of the pins for just screen and not touch. I need 12 of the gpio pins

Anonymous user #22

11 months ago
Score 0++

Finally got a solution to make sudo raspi-gpio set 8 a2 sudo raspi-gpio set 7 a2 get executed boot


Add those lines right before "EXIT" Block of file "/etc/rc.local"

Anonymous user #21

12 months ago
Score 0++

Hello, my display is a Version B - MZP280V00BR. I have installed the drivers like it is explained on this page, but only the backlight turns on. The image of the display is still black.

Which driver should i take for online installation of the MZP280V00BR display?

Anonymous user #20

12 months ago
Score 0++

How can I use rechargeable battery board like this one: https://bit.ly/32pqyj6

with Version-C

Anonymous user #19

13 months ago
Score 0++
Hi, try to get rid of the blue/yellow tint with no success. followed the instruction and also check /boot/mzp280v01br.txt already with "gpio=0-8=a2". but the screen does change back normal if i type the raspi-gpio command manually after boot up ... strange, any advice? setup is rp0w, version a screen, 07-10-buster

Anonymous user #18

13 months ago
Score 0++
Are any GPIO pins available for use when using this display, for example using a PIR motion sensor on one of the gpio pins simultaneously?

Anonymous user #17

14 months ago
Score 0++

Hi, I can fix the blue and white colors by running: sudo raspi-gpio set 7 a2 sudo raspi-gpio set 8 a2

but how can I change it at boot time? I added to config.txt this 2 lines: gpio=7=a2 gpio=8=a2

but doesnt work.

Thanks

Anonymous user #28

2 months ago
Score 0++

So the issue with the Blue/Yellow appears to be when the serial driver loads, it for some reason resets GPIO 7 & 8. So the setting that the vendor put in /boot/config.txt gets overridden.

So, I put the following mini startup script in to run on boot. Script location-name: /etc/systemd/system/fixgpio.service Script contents below:

[Unit] Description=fix gpio for screen

[Service] Type=simple ExecStart=/usr/bin/raspi-gpio set 7-8 a2

[Install] WantedBy=multi-user.target

Then run service fixgpio enable and reboot.

--Chris

Anonymous user #16

14 months ago
Score 0++

Hello There,

My setup are: - MZDPI-VGA-ZERO 2017.11.20 - VERSION: B - Raspberry PI ZERO WH

I cloned "tianyoujian/MZDPI.git" and then run all commands. But my screen doesn't work. Display backlights on. But no screen. Can you help me ?

Admin

14 months ago
Score 0++

Hello friend, Could you please follow the user guide:http://www.r...ro#Use_Guide Best regards,

Cindy/Geekworm

Anonymous user #16

14 months ago
Score 0++

Hello friend,

I run all commands but it still doesn't work. Do you have any other advice ? Is there a way to debug it ?

cd ~/ git clone https://gith...an/MZDPI.git cd MZDPI/vga sudo chmod +x mzdpi-vga-autoinstall-online sudo ./mzdpi-vga-autoinstall-online

sudo reboot

Anonymous user #15

14 months ago
Score 0++

I also tried using version C with raspberry pi zero w (Raspbian Buster) and it didn't work.

Is there a way to test the display without plugging into raspberry pi? i.e how do i tell if it's a fault display or driver issue?

Admin

14 months ago
Score 0++

Hi friend, Do you mean the LCD cannot light up? (1)It is directly control via software: sudo raspi-gpio set 18 op dh (turn on the backlight) sudo raspi-gpio set 18 op dl (turn off the backlight)

(2)Or you could add

gpio=18=op,dh

into the config.txt. then the backlight will be turned on as soon as the system is running.

Best regards,

Abby / Geekworm

Anonymous user #14

14 months ago
Score 0++
I tried using the Version C with a raspberry pi Zero W and it does not work at all

Admin

14 months ago
Score 0++

Hi, Do you mean the LCD cannot light up?

Answer:

This screen need configuration to be work. GPIO18 should be connected to the 12th pin of 40PIN.

And should add

gpio=18=op,dh,pd

in the config.txt.

Sudo raspi-gpio set 18 op dh turn on the backlight Sudo raspi-gpio set 18 op dl turn off the backlight

Best regards,

Abby / Geekworm

Anonymous user #12

15 months ago
Score 0++

Hi, I am also having the same issue with Rasbian Buster, yellow whites and blue blacks.

Anyone had luck fixing this? Perhaps the developer could assist?

Admin

14 months ago
Score 0++

Hi, Please run:

sudo raspi-gpio set 8 a2

sudo raspi-gpio set 7 a2

Anonymous user #13

14 months ago
Score 0++

Thank-you. That is much better. When I run those commands it is fixed!

Is there a way to fix the colour from start up? (the boot screen is still yellow/blue)

Admin

14 months ago
Score 0++

Hi, https://gith...stall-online

This installation script is be updated. and fix the color form start up.

Github: https://gith...oujian/MZDPI

Anonymous user #11

15 months ago
Score 0++
Is there any reason that this can't be used with a normal raspberry pi?

Admin

14 months ago
Score 0++

sudo raspi-gpio set 8 a2

sudo raspi-gpio set 7 a2

Anonymous user #10

15 months ago
Score 0++
Having the same problem on the latest Raspbian Buster with yellow tint to white colours and blue tint to black

Anonymous user #8

15 months ago
Score 0++
Has anyone gotten this screen to work with Volumio? I was able to get it working with Raspbian, but with Volumio I get a blue screen and it fails to boot.

Anonymous user #6

15 months ago
Score 0++

Hi,

My screen (Version-C) does not fully fit the diplay, they have border about 50px on each side. Also the display got a wrong color (Black goes blue, White go yellow and so on). I'm using recent raspbian buster version and download the latest drivers from GitHub. Thank you.

Anonymous user #7

15 months ago
Score 0++
I figured out about the borders. I just disable the double pixel in raspi-config then this will be fine. But the color problem is still.

Anonymous user #9

15 months ago
Score 0++
I’ve got the same thing on a version A and version C screen. Disabling pixel doubling didn’t help. All the blacks are blue-ish, and it’s a bit yellow too. No idea how to fix. Using fresh install of Raspbian Buster.

Anonymous user #9

15 months ago
Score 0++
I've resolved both the blue/yellow shift and the borders by using 2019-04-08-raspbian-stretch image with Version C screen. Please fix these for Raspbian Buster, it's so much faster for a Pi Zero.

Anonymous user #5

16 months ago
Score 0++

Hi,

Does the version-A 2.8 inch Touch Screen for Pi zero W use SPI or I2C interfacing?

Also, are any of those interfacing pins directly being used by the driver?

Thank you in advance!

Anonymous user #4

18 months ago
Score 0++
Can you dim the backlight on the original version?

Anonymous user #3

19 months ago
Score 0++
Hey I've got the V00BR Version:B, which 565 Mode is this screen using? I'd need to use the other GPIOs...

Admin

19 months ago
Score 0++

Hello, The screen use 565 mode, please refer to the GPIO PIN list here: http://www.r..._LCD_PIN.ZIP

The NC pin is not occupied by the screen, you can use it!

Anonymous user #2

19 months ago
Score 0++
This is SPI? Or HDMI? 16 bit color or 24 or 32?

Admin

19 months ago
Score 0++

Hello, The 2.8inch screen is consist of display screen and touch screen, The display screen is DPI, and the touch screen is SPI. And the screen is 16 bit color and RGB565 mode.

Best regards,

Cindy

Anonymous user #1

20 months ago
Score 0++

Kindly include the instructions for this product on this same page for others

gpio pwmc 1 # set clock 1000 makes noise for me gpio -g mode 18 pwm # enable PWM on GPIO18 gpio -g pwm 18 1010 # change screen brightness to 975 range 0 - 1024

https://www....t_manual.pdf

Admin

20 months ago
Score 0++

Hi, Thanks for your file, but our 2.8 inch screen is not waveshare product, please note, thank you very much. Best regards,

Cindy/Geekworm