Joy It 3.2 (Waveshare clone) display not working

I’ve got screens working by starting with a raspbian build and no encoders or audio cards and seeing if that an be configured…

i’ve attached my process notes from mucking around and getting a XPT2046 based touchscreen.

LCD Installation

XPT2046

![|294x393](file:///tmp/lu8077dbgksx.tmp/lu8077dbgktj_tmp_6f22ad84953ab2de.jpg) https://ozzmaker.com/piscreen-driver-install-instructions-2/

https://www.raspberrypi.org/forums/viewtopic.php?t=143581

pi@raspberrypi ~ $ sudo apt-get install fbi
pi@raspberrypi ~ $ wget https://ozzmaker.com/piscreen/image-test.gif
pi@raspberrypi ~ $ sudo fbi -noverbose -T 1 -a -d /dev/fb1 image-test.gif

export FRAMEBUFFER=/dev/fb1
sudo startx &
pi@raspberrypi:~/LCD-show $ cat /etc/os-release
PRETTY_NAME=“Raspbian GNU/Linux 10 (buster)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“10”
VERSION=“10 (buster)”
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“http://www.raspbian.org/RaspbianForums
BUG_REPORT_URL=“http://www.raspbian.org/RaspbianBugs
/usr/share/X11/xorg.conf.d/99-fbturbo.conf
#This is a minimal sample config file, which can be copied to
#/etc/X11/xorg.conf in order to make the Xorg server pick up
#and load xf86-video-fbturbo driver installed in the system.
#When troubleshooting, check /var/log/Xorg.0.log for the debugging
#output and error messages.

#Run “man fbturbo” to get additional information about the extra
#configuration options for tuning the driver.
Section “Device”
Identifier “Allwinner A10/A13 FBDEV”
Driver “fbturbo”
Option “fbdev” “/dev/fb1”
Option “SwapbuffersWait” “true”
EndSection

/boot/config.txt

#Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
#Additional overlays and parameters are documented /boot/overlays/README
#Enable audio (loads snd_bcm2835)
dtparam=audio=on
[pi4]
#Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
#dtoverlay=vc4-fkms-v3d
dtoverlay=piscreen,rotate=90
export DISPLAY=:0.0
/etc/X11/xorg.conf.d/99-calibration.conf
GNU nano 3.2 /etc/X11/xorg.conf.d/99-calibration.conf
Section “InputClass”
Identifier “calibration”
MatchProduct “ADS7846 Touchscreen”
Option “Calibration” “3853 170 288 3796”
Option “SwapAxes” “1”
EndSection

So far the touchscreen top and bottom is inverted.

Adding the terminal to the screen . . .
Enable Console on PiScreen

To move the console from the HDMI/RCA to PiScreen you have to updated /boot/cmdline.txt

1. Backup cmdline.txt

pi@raspberrypi ~ $ cp /boot/cmdline.txt ~/cmdline.txt

2. Update cmdline.txt

pi@raspberrypi ~ $ sudo nano /boot/cmdline.txt

Add the text below to the end of the first line. Not on a new line as this will not work.
Rotate will rotate the console on PiScreen. Rotate can be 0, 1, 2 or 3.

fbcon=map:10 fbcon=rotate:2 fbcon=font:ProFont6x11
pi@raspberrypi:~ $ ls -l /dev/input/event*
crw-rw---- 1 root input 13, 64 Feb 1 15:47 /dev/input/event0
pi@raspberrypi:~ $ cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name=“ADS7846 Touchscreen”
P: Phys=spi0.1/input0
S: Sysfs=/devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input0
U: Uniq=
H: Handlers=mouse0 event0
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

modern X11 like what is on Buster should work without any custom configuration. Do you have something strange in /etc/X11/xorg.conf of in /etc/X11/xorg.conf.d/*? If so, please try removing it.

It would also be useful to know more about your graphics setup. Install inxi (if you don’t already have it), then run and post the output of the following:

Code:
inxi --graphics
08022020
Burned zynthian to 32G
loaded to 3B+ with above screen.
With HDMI monitor sonnected continually reboots.
![|531x398](file:///tmp/lu8077dbgksx.tmp/lu8077dbgktj_tmp_149a555cf361dbc3.jpg)

Justthe touchscreen boots but webconf available.
Left right on touchscreen swapped.
Zynscreen 3.5(v1)
(Power connector at top)
Left right on touchscreen swapped.
dtoverlay=piscreen2r-notouch,rotate=270
dtoverlay=ads7846,
speed=2000000,
cs=1,
penirq=17,
penirq_pull=2,
swapxy=1,
xohms=100,
pmax=255
![|643x401](file:///tmp/lu8077dbgksx.tmp/lu8077dbgktj_tmp_12fb9e0068772776.jpg)
PiScreen 3.5 (V1)

(Power connector at top)
Left right on touchscreen swapped.

dtoverlay=piscreen,speed=16000000,rotate=90
PiScreen 3.5 (V1)
(Power connector at top)
Left right on touchscreen swapped.
dtoverlay=piscreen,speed=16000000,rotate=0
Width=320
height=480
dev/ fb1
![|643x401](file:///tmp/lu8077dbgksx.tmp/lu8077dbgktj_tmp_12fb9e0068772776.jpg) dtoverlay=piscreen,speed=16000000,rotate=90
To try to reorientate the touchscreen . . .

With the @rod_amaral help, I finally got sucess on LCD configuration (and how to disable the built-in mic from audioinjector).

To disable the audioinjector microphone, I’ve followed these steps:

  1. alsamixer
  2. F5
  3. Navigate to MIC Option and press space.

To enable the audioinjector RCA inputs, I follow these steps:

  1. alsamixer
  2. F5
  3. Enable L/R CAPTURE to LINE and change INPUT Mux to Line In.

To configure the touchscreen, I’ve followed these steps:

  1. apt-get install -y xinput-calibrator (to download/install the touchscreen calibrator)
  2. Create a file calibrate.sh with the content:
    #!/bin/sh
    xinput_calibrator -v
  3. chmod +x calibrate.sh (to make it executable)
  4. systemctl stop zynthian (stop zynthian)
  5. startx ./calibrate.sh (start the calibrator)
  6. Touch the four points on the screen
  7. Update the 99-calibration.conf with the result of calibrator run
    Section “InputClass”
    Identifier “calibration”
    MatchProduct “ADS7846 Touchscreen”
    Option “MinX” “3868”
    Option “MaxX” “63578”
    Option “MinY” “61610”
    Option “MaxY” “2901”
    Option “SwapXY” “0” # unless it was already set to 1
    Option “InvertX” “0” # unless it was already set
    Option “InvertY” “0” # unless it was already set
    Option “TransformationMatrix” “-1 0 1 0 1 0 0 0 1”
    EndSection

At end, I’ve changed the LCD to PiScreen 3.5 V1 on the webconf.

My results …

With the @rod_amaral help, I finally got sucess on LCD configuration (and how to disable the built-in mic from audioinjector).

To disable the audioinjector microphone, I’ve followed these steps:

  1. alsamixer
  2. F5
  3. Navigate to MIC Option and press space.

To enable the audioinjector RCA inputs, I follow these steps:

  1. alsamixer
  2. F5
  3. Enable L/R CAPTURE to LINE and change INPUT Mux to Line In.

To configure the touchscreen, I’ve followed these steps:

  1. apt-get install -y xinput-calibrator (to download/install the touchscreen calibrator)
  2. Create a file calibrate.sh with the content:
    #!/bin/sh
    xinput_calibrator -v
  3. chmod +x calibrate.sh (to make it executable)
  4. systemctl stop zynthian (stop zynthian)
  5. startx ./calibrate.sh (start the calibrator)
  6. Touch the four points on the screen
  7. Update the 99-calibration.conf with the result of calibrator run
    Section “InputClass”
    Identifier “calibration”
    MatchProduct “ADS7846 Touchscreen”
    Option “MinX” “3868”
    Option “MaxX” “63578”
    Option “MinY” “61610”
    Option “MaxY” “2901”
    Option “SwapXY” “0” # unless it was already set to 1
    Option “InvertX” “0” # unless it was already set
    Option “InvertY” “0” # unless it was already set
    Option “TransformationMatrix” “-1 0 1 0 1 0 0 0 1”
    EndSection

At end, I’ve changed the LCD to PiScreen 3.5 V1 on the webconf.

$ xinput list

$ xinput list-props “ADS7846 Touchscreen”

This is coordinate transformation matrix that transform from input coordinate(x, y, z) to output coordinate(X, Y, Z).

⎡1 0 0 ⎤
⎜0 1 0 ⎥
⎣0 0 1 ⎦

ON this setup we need to swap x & y . . .

in case of swapping x and y,

  ⎡ 0 1 0 ⎤ 
  ⎜ 1 0 0 ⎥ 
  ⎣ 0 0 1 ⎦ 

Option “TransformationMatrix” “0 1 0 1 0 0 0 0 1”


My results . . .

Section "InputClass"

Identifier "calibration"

MatchProduct "ADS7846 Touchscreen"
Option "MinX" "48452"
Option "MaxX" "49134"
Option "MinY" "22198"
Option "MaxY" "22107"
Option "SwapXY" "1" # unless it was already set to 1
Option "InvertX" "0" # unless it was already set
Option "InvertY" "0" # unless it was already set
`Option
"TransformationMatrix" "0 1 0 1 0 0 0 0 1"`
EndSection
1 Like