Waveshare 5 inch and raspberry PI

I am setting up a Raspberry PI 3B with Volumio for my son. Bought a waveshare 5" HDMI LCD v2 but can’t get the screen and the touch running.
I had it running once, but by mistake installed a beta and all was gone.

Now I cannot find the page where I found the original installation.
Can anyone please help? Thanks a lot.

2 Likes

maybe you find here your anwsers :

2 Likes

Assuming you have this display and you are starting with a fresh Volumio system open /boot/userconfig.txt and add the following lines:

dtparam=spi=on
hdmi_drive=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
dtoverlay=ads7846
dtparam=cs=1
dtparam=penirq=25
dtparam=penirq_pull=2
dtparam=speed=50000
dtparam=swapxy=0
dtparam=pmax=255
dtparam=xohms=150
dtparam=xmin=200
dtparam=xmax=3900
dtparam=ymin=200
dtparam=ymax=3900

Save /boot/userconfig.txt and reboot. Install the Touch Display plugin and enable the plugin. Report back if display and touch already work. If not we would have to try some additional steps.

Edited: dtoverlay=ads7846 and its parameters have been split to separate lines according to post #14.

3 Likes

I will try this. This is indeed my screen, do i not need to install any drivers on the Pi?

No, I don’t think so. It could be that xserver-xorg-input-evdev has to be installed additionally but at first try without that, please.

I have done this, but not working. any suggestion

1 Like

Could you describe the current state a little more in detail please?

Is the display lit?

Do you see a login screen?

When you start the Touch Display plugin, do you get any error messages from the UI, if so what do they say?

Also please post the content of your /boot/config.txt and /boot/userconfig.txt.

it is working again !!! Thanks

1 Like

Great!

Adding the entries to /boot/userconfig.txt was sufficient?

1 Like

Yes

1 Like

Thanks for your feedback. :smiley:

If applicable please mark the thread as solved.

can I bother you some more?
The screen is working, touch as well but very slow and not very responsive. What can I do to improve that?

1 Like

These displays use the SPI bus for touch information which is typically limiting the speed. Further more the touch is not capacitive but resistive which means the display needs some physical pressure to detect a touch. So I think the possibilities to speed up touch are pretty limited. At least with a justifiable effort.

What you could try is upping the speed value (which sets the speed of the SPI bus) in the line you added to userconfig.txt:

dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900

According to this readme the default speed is 2MHz and the value used is 50kHz. The lower value is taken from the config-5.txt file of Waveshare. This does not mean higher values won’t work but I have no experience with that and can’t predict the effects of a higher value.

P.S. The “xohms” value you see in the dtoverlay line controls the sensivity of the touchpanel. So you may play with that value, too, to improve responsiveness.

P.P.S. Do you have any other hardware connected that possibly uses the Raspberry’s pin 22 (GPIO25)? This might interfere with the touch panel which also uses this pin to detect / signal touches (penirq=25).

2 Likes

I just saw that an 80 character per line limit applies to entries in /boot/config.txt. I suppose that this holds true for /boot/userconfig.txt, too. According to the linked readme any characters exceeding the limit will be ignored.

The entry beginning with “dtoverlay=ads7846…” has more than 80 characters. So I have to reason that the parameter keep_vref_on=0 is the last one that is complete and gets processed whereas all following parameters get dropped, so amongst others xohms=150.

To circumvent the character limit split the “dtoverlay=ads7846…” like this:

dtoverlay=ads7846
dtparam=cs=1
dtparam=penirq=25
dtparam=penirq_pull=2
dtparam=speed=50000
dtparam=swapxy=0
dtparam=pmax=255
dtparam=xohms=150
dtparam=xmin=200
dtparam=xmax=3900
dtparam=ymin=200
dtparam=ymax=3900

I removed the parameter keep_vref_on=0 as this seems not be valid for the ads7846 overlay (readme). I have no clue why Waveshare has that parameter in its config-5.txt file I have linked above…

2 Likes

gvolt, you are the best !!!
Now the screen is responsive and works flawless

Thanks a million

2 Likes

:grin: What was the solution?

@gvolt I had an old Waveshare 5" HDMI display laying around, I’m using it for preparing a Volumio setup for a friend of mine. Your trick of the split in several lines made the touch working decently, finally! Many thanks!

2 Likes