User avatar
saper_2
Posts: 239
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

[Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Sun Feb 26, 2017 4:27 pm

Hi,

This time the longest post in my history :P. I hope you won't kill me for length of this post and neither for my English (I'm not native-English-speaker :) )
Everything I have written is based on my observation and experience in electronic circuits. All information that I compiled below in this review I found using a Google-fu

Content:
  • 0. Intro - why
  • 1. The Package - (not so black-)box content
  • 2. The Sandwich - unfortunately not eatable, but how things fit
  • 3. The Display - closer look on display module
  • 4. Testing under Windows - :geek:
  • 5. Teardown - :twisted:
  • 6. Raspbian tests - :)
  • 7. Summary - Plus and Minus
  • 8. Configuration - setting up display & touch on Raspbian Jessie 2017-01-11 - :ugeek:
0. Intro
I ordered some time ago a new display for RPi of (disliked till now by me) a brand: KeDei . There might be some people who know, that I don't really liked those KeDei displays, they looks cool and slick, but no driver code and they slowness was so irritating. I even attempted to rebuild the spi interface so it might be used with fbtft but I gave up (and the display gave up too :D ).
Now you think: "Wait, wait, wait, he bought next KeDei display!? Did he hit his head too hard?!"
Ok, my head is fine :D I found this new version of KeDei display while digging through aliexpress for 3,5" TFT display. So I ordered one and give a chance for KeDei to redeem his sins ;) committed on previous displays :D...

I got a package right before weekend so I can play with it :D

All photos are here at my google drive: https://drive.google.com/drive/folders/ ... ndWY2VhTUk

1. The Package
Display was packed in small cardboard box with that white foam, and the box was put into plastic-bag envelope. In box I found a HDMI bridge, stylus and display :) :
kedei-hdmi-box.jpg
kedei-hdmi-box.jpg (60.83 KiB) Viewed 46153 times
Pretty standard content for the HDMI display with touch for SBCs :)

Photos here: https://drive.google.com/open?id=0BySjz ... TB2Y2MxbjQ

The display looks fine, there is a little of solder flux leftover on board but that might be only in my display, and I'm not bothered by it anyway.

The hdmi bridge - yeah, I have to complain about something :D : it's dirty, there are a residues (the white "thing") from cleaning after soldering - this looks really untasteful....

As for stylus, nothing really to comment, the tip is smooth - don't have any sharp edge.

2. The Sandwich
Let see now how the display fits RPi. I got recently Raspberry Pi 2.2 (Pi2 v1.2 , but "2.2" sounds and looks better :P ) :
kede-hdmi-sandwich.jpg
kede-hdmi-sandwich.jpg (58.84 KiB) Viewed 46153 times
More photos in HQ: https://drive.google.com/open?id=0BySjz ... VpqVEdWc1E

AS you can see, the HDMI socket is a slight off to RPi HDMI socket, so to connect the display with the bridge you have to a twist and bend a little the display board. You can see this on photos. The hdmi bridge is too short or the GPIO connectors are too long (pick one :P ).
The best way to fix this would be to desolder the GPIO connectors, remove one spacer, put the display together with RPi and de-soldered GPIO connectors, then solder the GPIO connector back to the display board.

3. The Display
Let's take a look at display :D
kedei-hdmi-display.jpg
kedei-hdmi-display.jpg (54.23 KiB) Viewed 46153 times
Photos: https://drive.google.com/open?id=0BySjz ... HdiUEpINHc

There is few chips on the board and the GPIO connector is split into two parts (that's common in kedei displays), also we got a microusb for power, jack 3,5mm for audio output and backlight switch - YES! (but I bet there will be personas that would want to control the backlight from GPIO pin :D:D )
Now, let's take a closer look at parts we've got on display:
  • RTD2660H - It's main performer here - Realtek RTD2660H is a "Flat panel controller" - it support a lot of video inputs (HDMI/DVI/VGA/S-VIDEO(composite)) and have two video outputs: LVDS and TTL, it have audio decoder, DDC, MCU core and even OSD - hmmm... this looks like it could be installed on those boards-adapters HDMI/DVI/VGA to LVDS that are for ~14USD on aliexpress... Anyway, in KeDei it have only HDMI input used, as for output I'm not sure, but it might have very likely used a TTL output mode.
  • 25X40 - Winbond W25X40CLNIG - 4Mbit SPI NOR-Flash memory - there is probably a firmware for MCU inside RTD to init display & show "KeDei logo" :)
  • CS4334K - Cirrus Logic CS4334 (It's been a while since I saw this name...) - It's a 24bit 96kHz stereo D/A converter with 16..24bit I2S interface.
  • XPT2046 - Shenzhen Xptek Technology XPT2046 - a resistive touch panel controller with SPI interface - no need for more comment :)
  • 4103 - PowerTech PT4103 - it's a tiny (chassis SOT-23-6) step-up dc/dc white led driver - next one popular chip
  • AMS1117-x.x (where "x.x" is voltage) - are voltage regulators for RTD & display panel - the 1.8V looks ok, but marking on 3.3V version looks soo strange, that I would say it's some clone of AMS1117...
  • Display connector - It's a fine-pitch (0.3mm) connector with 39 pins :) - Yeah, I counted them :P
  • Backlight switch - very demanded function in those small displays, in this one we don't break only backlight led circuit but we switch off whole backlight driver (turn off power to PT4103),
  • Micro Usb - Only for powering the display & Pi, you should use only one: On RPi or on the display, but the one on display is not protected by fuse and connects directly to RPi 5V bus
  • Touch panel - not much to comment but I should mention that the FPC cable from touch panel is directly soldered to PCB, this is a reason of the piece of tape on display... :twisted:
  • Raspberry Pi GPIO connector - It's used to power the display module (or power the Pi - depends where you plug the power cable: to the Pi or to the display), and for touch panel controller interface - the XPT2046 is connected to SPI and use CS0 for chip select.
  • The Display - it's a 320x480 TFT panel with 18bit RGB I/F, part number (in my module): S90329A-DT035HV , very likely manufactured by Yunlea . Googling for DT035HV reveled a link to very similar (in size and FPC pinout) display: S90456B-DT035HV - difference is only on length of FPC connector and it's distance from display edge. As for viewing angles, they are not so bad for a normal TFT (or at least for me :D ).
    The user shahidali55 (topic: viewtopic.php?p=1247639#p1247639 ) found out the Aliexpress seller who might have exactly the same display: https://www.aliexpress.com/item/3-5-inc ... 87937.html - Looking at the photos on aliexpress the fpc and marking seems for me identical.
    According to the information from aliexpress:
    • Controller: ILI9481B
    • Interface: Selectable: SPI or parallel RGB 18bit
    • Backlight: 7 white leds.
    (If I have more info about this display I will do update :) )
  • Touchpanel - resistive 4 wires, for 3.5" displays 82x54mm size. The FPC from touch panel is soldered directly to PCB.
Some video of powering up display without input :D : https://youtu.be/9SkWyBYNpz4

4. Windows testing
Yeaaaa, windows 10. So I hooked the display to my laptop to HDMI. It have a scaler built-in into but it have it's limits too :) , so on movie this look bad, I managed later to setup my GPU so it could output some more (lower and) reasonable resolution that work much better with screen. Photos are on my GDrive (link up) :

Video: https://youtu.be/nUleItIr47s

Photos: https://drive.google.com/open?id=0BySjz ... mxtbTJJT1k

5. Teardown
OK, display working , time to break it apart! I wouldn't be myself if I won't do it :D, let's have a look what is under the TFT panel :D
If somebody noticed a black wire on photos then you'll see it's purpose :D
No photo in post - forum limit 3 attachments :cry:

Check the photos on google drive: https://drive.google.com/open?id=0BySjz ... ENpVVhkMnc

Display is glued to PCB with double-sided adhesive foam - there is 2 long pieces of it, but on photos I had them short already, it came off much easier that in previous version but the touch panel FPC is soldered to PCB and you have to really be careful with it (I pulled it a little too much and, now I had to put a piece of foam on the FPC soldered to PCB and squeeze it down with piece of tape :| so I have a electrical contact...)

Now you see what is going with the black wire :D - it's grounding for display metal frame :lol:

The display connector as mentions have 0.3mm pitch... And in my board the soldering is nooooot so beautiful ;)

Putting it together took mi a bit more time than breaking apart, I had to play around with positioning the tft panel around to make the display FPC fit nicely into it'd connector, and also not having the FPC from touch panel bent too much, too.

You'll be able to see this tape on video with testing the display on Raspbian :D

6. Raspberry Pi Tests
Image quality is not so bad, on photos & movies it came off a much more blue/colder than it is really. Backlight it not so dark but might be a little stronger so the display would be a brighter.

Test video: Sintel 1080p 24fps and Big Buck Bunny 1080p 30fps

Native 480x320px:
Photos: https://drive.google.com/open?id=0BySjz ... UFzaXJRVUU
Video: https://youtu.be/KEcTwjyhUE4

720x480px:
Photos: https://drive.google.com/open?id=0BySjz ... HVEMnBtVTQ
Video: https://youtu.be/wdkO9-3n3r8

810x540px:
Photos: https://drive.google.com/open?id=0BySjz ... WVtUDF4Sk0
Video: https://youtu.be/Ip9ib1P-eXI


7. Summary
This time KeDei did a good job with this display, they must see that users were complaining a lot because of very low fps, they must take those to heart and designed a nice piece of hardware. With the moving from SPI to HDMI for displaying, now we can run console emulators, play h264 video and do other things that fully utilize GPU in SoC on RPi , and of course, use of HDMI allow to connect this display to other SBCs too :) .
So the "pluses":
  • HDMI - allow to connect practically any video source to the display (laptop PC/ Raspberry/Orange/Bana -Pi / BBB / etc)
  • Audio output - stereo 3,5mm jack
  • Size of Raspberry Pi
  • XPT2046 touch
  • MicroUSB for powering display and Pi
  • No need for propriety drivers (per-compiled kernel) from KeDei
  • built-in video scaler
  • Backlight switch
But having only positive points would be too candy, so now, negative:
  • Price: ~25USD with shipping for 3,5" & touch display with HDMI - for 27USD with shipping you can get 5" display with HDMI input
  • Don't fit so good, the display sits awry on Pi
  • Too long GPIO connectors/too short HDMI bridge
  • Touch panel FPC soldered directly to PCB
  • The RTD get a pretty warm with whole board
  • No fuse(polyfuse) on MicroUSB power connector, especially because it's connected direct;y to 5V bus on RPi
  • Display is a bit too dark
Now, you decide, if you want to pay 25USD for that small display, or add 2USD more and get 5" with touch :)

In next post I'll put an instructions how to setup the display & touch using latest raspbian (this make it easier to link-up than scrolling through my post :) ).

-- Changelog --
  • 2018-01-03 - Added some display info.

Last edited by saper_2 on Wed Jan 03, 2018 10:44 pm, edited 4 times in total.

User avatar
saper_2
Posts: 239
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Sun Feb 26, 2017 4:27 pm

8. Setup

I used Raspberry Pi 2 v1.2 , and latest Raspbian:

Code: Select all

2017-01-11-raspbian-jessie.img
8.1. Image prepare
Burn image to µSD card - I used on windows "Win32 Disk Imager" to write raspbian sysimage on card.
Now I enabled ssh by placing file "ssh" (no extension, nothing in file) beside config.txt - there is a few way to do it :D . Simplest from command prompt in sd card drive directory:

Code: Select all

echo "" > ssh
But you can connect a keyboard to Rpi and use raspi-config to enable ssh.... That's up to you :)


Like I mentioned earlier, the RTD have video scaler in it, so if it get bigger resolution at input it'll down-scale it to fit the physical screen resolution. I have tested few resolutions, and come to conclusion that the best are:
  • 480x320px 60Hz - This is native TFT panel resolution
  • 720x480px 60Hz - this looks good too and it's not so hard to use stylus at this resolution too :D
KeDei propose another: 810x540px but it's a bit too much already for this TFT panel.

Here is what need to be set in config.txt to use this display (this is only a part of the file):

Code: Select all

# Force use HDMI
hdmi_force_hotplug=1
# force a specific HDMI mode
hdmi_group=2
hdmi_mode=87

# custom display resolution (480x320 looks good , and 720x480 is not too bad too,3rd res is: 810x540 )
#         /----------------- Width: 480px ( or 720px /or 810px)
#         |   /------------- Height: 320px ( or 480px /or 540px)
#         |   |   /--------- Refresh: 60Hz
#         |   |   | /------- Aspect ratio: 6=15:9 (1=4:3, 2=14:9, 3=16:9, 4=5:4, 5=16:10)
#         |   |   | | /----- Margins: 0=disabled (1=enabled)
#         |   |   | | | /--- Interlace: 0=progressive (1=interlaced)
#         |   |   | | | | /- Reduced blanking: 0=normal (1=reduced)
#         |   |   | | | | |
hdmi_cvt 480 320 60 6 0 0 0

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2
This is all what need to be changed for the display to be able to see on it something.
Now save config.txt, eject card from PC and put it into RPi, connect LAN, display and power up Pi, further I'll be using SSH :D

8.2. Preparation for touch
I assume you have booted Pi, let's it reboot after initial-resize and you got desktop picture on display :D
You should see message box: SSH enabled but default pi password has not been changed .
Well, I'm always change pi password so anyway, via ssh:

Code: Select all

[email protected]:~ $ sudo passwd pi
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
[email protected]:~ $ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Now you should run apt-get update & upgrade to be up-to-date with system packages and kernel :)

Code: Select all

[email protected]:~ $ sudo apt-get update
.....
[email protected]:~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
.....
I didn't used raspi-config before, so I do it now - I setup locale, time zone, raspberry pi hostname:

Code: Select all

[email protected]:~ $ sudo raspi-config
.....
Now reboot:

Code: Select all

[email protected]:~ $ sudo reboot
Install what we'll need for adding support for touch:

Code: Select all

[email protected]:~ $ sudo apt-get install xinput-calibrator
....
I'm using vim as text editor in bash (linux shell), you can use anything you like, e.g.: nano - just replace my "vim" with "nano" :)

8.3. Enabling touch controller
Now, when the display show a desktop, let's set up the touch:

Code: Select all

[email protected]:~ $ sudo vi /boot/config.txt
Edit /boot/config.txt and add at end:

Code: Select all

dtparam=spi=on
dtoverlay=ads7846,cs=0,penirq=25,speed=10000,penirq_pull=2,keep_vref_on=1,xohms=150
Yes, that's it - almost, we have now left calibration & config file for X .
Let's take care at least for directory structure for X-server configuration, and reboot:

Code: Select all

[email protected]:~ $ ls /etc/X11
app-defaults             ja_JP.eucJP  rgb.txt  xkb       Xresources  Xsession.options
default-display-manager  ja_JP.UTF-8  X        Xreset    Xsession    Xwrapper.config
fonts                    openbox      xinit    Xreset.d  Xsession.d
[email protected]:~ $ sudo mkdir -p /etc/X11/xorg.conf.d
[email protected]:~ $ ls /etc/X11
app-defaults             ja_JP.eucJP  rgb.txt  xkb          Xreset.d    Xsession.d
default-display-manager  ja_JP.UTF-8  X        xorg.conf.d  Xresources  Xsession.options
fonts                    openbox      xinit    Xreset       Xsession    Xwrapper.config
[email protected]:~ $ 
Once you get back to desktop, touching screen should make cursor move - in strange ways but that's mean touch working at least :) .
Now run xcalibrator from desktop menu (e.g.: using mouse) or in ssh run DISPLAY=:0.0 xinput_calibrator
calibrate-kedei-hdmi-touch-screenshot.png
calibrate-kedei-hdmi-touch-screenshot.png (47.11 KiB) Viewed 46014 times
E.g.:

Code: Select all

[email protected]:~ $ DISPLAY=:0.0 xinput_calibrator
        Setting calibration data: 0, 4095, 0, 4095
Calibrating EVDEV driver for "ADS7846 Touchscreen" id=6
        current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095

Doing dynamic recalibration:
        Swapping X and Y axis...
        Setting calibration data: 103, 3893, 3939, 124
        --> Making the calibration permanent <--
  copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "103 3893 3939 124"
        Option  "SwapAxes"      "1"
EndSection
calibrate-kedei-hdmi-touch-screenshot-points.png
calibrate-kedei-hdmi-touch-screenshot-points.png (3.84 KiB) Viewed 46014 times
We've already created the directory mentioned in output of xinput-calibrator so just create file /etc/X11/xorg.conf.d/99-calibration.conf:

Code: Select all

[email protected]:~ $ sudo vi /etc/X11/xorg.conf.d/99-calibration.conf
And put there lines from "Section" to "EndSection" :

Code: Select all

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "103 3893 3939 124"
        Option  "SwapAxes"      "1"
EndSection
Save file, and reboot for changes to take effect (you can also reboot x-server but reboot whole pi is easier :D):

Code: Select all

[email protected]:~ $ sudo reboot
8.4. E N D
Now your touch should work :D

Well, mine - won't anymore :lol: (you could see it was working pretty fine :D on videos)...
I broken the FPC completely when I was removing the screen again today (it was a little twisted so I I wanted to straighten it - baaad idea...) :lol: I have to order now a new touch panel - it's hard to find a panel for this dimension screen :( .... Wait, I might still have the displays working on spi, maybe I'll be able to do some "touch panel transplantation" :lol:

8.5. Credits
I based my configuration description on tutorial viewtopic.php?p=947933#p947933 by mastermushi with some changes :)
THX mastermushi :)

8.6. Update for GL Driver
Clemens500 got me interested in GL driver (in full KMS mode) and the issue with resolution. The display actually don't have in EDID data the native resolution, but if it can work from hdmi_cvt option then WHY it don't want to work in native resolution set by xrandr. After some digging and few dozens of commands xrandr, tvservice and others I figured it out:
The scaler chip don't accept as proper HDMI signal when this one have around 12MHz (this is a pixel clock frequency for 480x320RGB - I think the scaler have lower-limit around 20-few MHz) and this exact frequency is calculated by xrandr .
But WHY it works with hdmi_cvt, well hdmi_cvt actually make the hardware to generate 47MHz pixel clock with 4-pixels-data per one physical pixel, the scaler chip detect this and display only every 4th pixel... (so the transferred image have actually 1920x320 resolution / 4x480=1920! )
Solution
Ok, but how to make working GL in native resolution. The trick is dirty simple :twisted: :twisted: :twisted:
Setup the display for 1920x320px and just apply a scale parameter to xrandr and volia! :lol: :lol: :lol: :lol: :twisted: :twisted: :twisted: :twisted:
Just see the simple script I created:

Code: Select all

[email protected]:~ $ cat gldrvtest
#!/bin/bash
DISPLAY=:0 xrandr --newmode test1 47 1920 1984 2144 2368 320 323 326 336 -hsync +vsync
DISPLAY=:0 xrandr --addmode HDMI-1 test1
DISPLAY=:0 xrandr --output HDMI-1 --mode test1
DISPLAY=:0 xrandr --output HDMI-1 --scale 0.25x1

[email protected]:~ $ ./gldrvtest
If you are NOT running this script from SSH then remove "DISPLAY=:0" text from each line - this is to tell the xrandr that it have to use physical display not the "virtual" one from ssh connection (I was running this remotely via ssh)
Before running script, and after :
xrandr_resize_scale_test1.jpg
xrandr_resize_scale_test1.jpg (62.58 KiB) Viewed 22922 times
And the video with glxgears : https://youtu.be/mCWVoIqLA1E
Last edited by saper_2 on Sun Mar 18, 2018 10:27 pm, edited 3 times in total.

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Fri Mar 10, 2017 6:14 pm

Saper! You are awesome! Thanks for this awesome article, I really liked it to read (I like long and much information articles)!

I'm happy that I bought (arrived already today) it, I little wonders about quality (last time it has been horrible with KeDei), but I'm gladly surprised, because it's really great and I'm even happier when you say the components are good!

That information for using a "native" drivers for touchbar is really useful, KeDei's kernels has been "broken" and contains malwares! YEAH!

BTW, All the chips onboard have little bit bigger temperatures (It's scorch on finger). I hope it will not burn :lol:

Thank you saper & mastermushi!
Cheers from Slovakia ;)

User avatar
saper_2
Posts: 239
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Fri Mar 10, 2017 7:23 pm

Thank you for you kind words :D :D

I mention it too in "minuses :) I think the main culprit is RTD (those like to get warm, beside check TFP401 by TI , it has exposed pad under - even if this is a just plain TQFP package - the pad have to be soldered to pcb for heat dissipation from chip structure - so yes, those must get warm), and if you using scaler in it (this happens when you feed display with higher resolution than the TFT panel have: 480x320) then it will get much more warmer too (it has to down-scale input video to 480x320).
PT4103 and rectifiers around it will get warm too...

How yours display fit Pi with the HDMI bridge?

fq1888
Posts: 10
Joined: Mon Mar 06, 2017 1:13 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Tue Mar 14, 2017 10:37 am

I tested with the newese Raspbian version:Version:March 2017
Release date:2017-03-02
I did the same as your step,display is OK,but when using xinput-calibrate,it seem no can be calibrate with version2017-03-02 ,touch still is not fit to the display.(my touch is tested OK for old Raspbian version)
do you known why?

User avatar
saper_2
Posts: 239
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Tue Mar 14, 2017 1:40 pm

fq1888 wrote:I tested with the newese Raspbian version:Version:March 2017
Release date:2017-03-02
I did the same as your step,display is OK,but when using xinput-calibrate,it seem no can be calibrate with version2017-03-02 ,touch still is not fit to the display.(my touch is tested OK for old Raspbian version)
do you known why?
Unfortunately I can not help you :cry:
My touch is permanently destroyed :( , I even tried transplanting touch panel from my old kedei's displays but when I almost done with prying it off it got broken :cry: .
I found that with latest release (the March one), the touch input in X was changed from evdev to xinput and this is causing a lot of issues around.
Check those links, maybe you'll find solution from them:

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Tue Mar 14, 2017 6:44 pm

fq1888:
I have 2017-03-02-raspbian-jessie package, the touch works, but X Y axes is swapped (and probably flipped/mirrored), xinput_calibrator doesn't help me too. I tried to swap axis via config.txt via swapxy (swap-xy too), then tried to play with configurations, the configurations has been loaded (/usr/share/X11 or /etc/X11), nothing helped.

saper_2:
My HDMI bridge is little longer and is really going hard into connectors + the side with HDMI is little lower as in opposite side.

UPDATE: I already reads your new post, I try to experiment with it and fix it!

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Tue Mar 14, 2017 10:20 pm

I found how to fix the problem with touchscreen, first I provide here a simply steps for three one resolutions, then the step-by-step way how to calibrate custom resolution (look down for explanation).

1. Delete all existing configurations of calibration

Code: Select all

sudo rm /usr/share/X11/xorg.conf.d/99-calibration.conf
sudo rm /etc/X11/xorg.conf.d/99-calibration.conf
2. Create new calibration configuration
Create file /usr/share/X11/xorg.conf.d/99-calibration.conf and put on it this:

Code: Select all

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option "TransformationMatrix" "REPLACE_THIS"
EndSection
Then, replace REPLACE_THIS text with text below by your resolution and orientation:
480x320, default orientation: 0 1 0 -1 0 1 0 0 1

I don't have any other matrices (but 480x320 matrice work good on all other resolutions, only corners are little broken), because I still failing to rotate the calculated matrix 90 degrees counterclockwise.
But for now it's work :-)

fq1888
Posts: 10
Joined: Mon Mar 06, 2017 1:13 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Wed Mar 15, 2017 4:01 am

Hello GAMELASTER ,
I have try your mathod, tesed with Raspbian-2017-03-02

sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf

Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1"
EndSection

It swap xy succefully, very good,It solve the problem that XY is inversed, the touch can be Barely usable,thanks.


but the touch coordinates is still need a calibration ,how to make the calibration-value Have an effect?
I have try use the command in 99-calibration.conf:
Option "Calibration" "3936 227 268 3880"
No effect.
Option "CalibrationMatrix" "3936 227 268 3880"
No effect.
Option "Calibration Matrix" "3936 227 268 3880"
No effect.
Option "Evdev Axis Calibration" "3936 227 268 3880"
No effect.

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Wed Mar 15, 2017 7:44 pm

fq1888:
I'm happy to know my solution helped, for you calibration question.
For calibration is needed to add values into axis offsets in matrix, but I can't test it due to failing at rotating the matrix.
I need to wait for someone who are good in Math :-)

DarkoSan
Posts: 5
Joined: Fri Mar 03, 2017 1:25 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Mon Apr 03, 2017 12:38 pm

Thank you saper_2 for the wonderful review and setup instructions. They helped a lot with the setup.

My Current Setup is:
Raspberry Pi 3 Model B
KeDei 3.5" HDMI 3.5”
Raspbian 2017-03-02

I was able to configure touch in X11 and it works perfectly, but in Kodi 15.2 there is a displacement.
Graphically it is represented here:
Image

I’ve tried configuring such file without success:
http://kodi.wiki/view/Advancedsettings.xml#touchscreen

Some other ideas? Had someone have Kodi working with touchscreen?

sommers9
Posts: 4
Joined: Mon Jan 02, 2017 1:31 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Sun Jun 18, 2017 6:16 pm

My touchscreen is working quite reasonably, even within the corners (though I have to press a little harder I believe).
I've used the "matrix" as explained above.
And then added the line option for calibration (the lines that were returned by the "calibration application" as described above.

So in: sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf

I have:

Code: Select all

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
        Option  "Calibration"   "90 3925 174 3968"
        Option  "SwapAxes"      "0"
EndSection
It seems to work quite reasonably on Raspbian (I've got a triple-boot: "raspbian, openelec, retropie"), but haven't yet got it to work on the others.

SeEnCreaTive
Posts: 1
Joined: Mon Jun 26, 2017 3:25 am

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Mon Jun 26, 2017 3:27 am

I picked on up, although all images plugged in through HDMI seem to be squished along the X-axis. Anyone know why?

User avatar
saper_2
Posts: 239
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Mon Jun 26, 2017 4:02 pm

SeEnCreaTive wrote:I picked on up, although all images plugged in through HDMI seem to be squished along the X-axis. Anyone know why?
:shock: what?

Do you mean, you have black margins at left/right side? Then you might not use a resolution in 3:2 proportion. I have written what resolutions works fine with this display, but I don't exclude that the KeDei might released new batch with a bit changed settings in HDMI converter chip on display.
In my review I have written what resolutions work best.

Spirevipp
Posts: 1
Joined: Mon Jul 03, 2017 8:20 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberr

Mon Jul 03, 2017 8:32 pm

i have gotten my display and touch working, except that the touch is wrongly configured.
In the center of the display its almost completely accurate. Then when moving the stylus outwards it get more and more offset, until it stops about 0.5cm before the edge.
this is my /usr/share/X11/xorg.conf.d/99-calibration.conf file:

Code: Select all

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
	Option "Calibration" "3853 170 288 3796"
	Option	"SwapXY"	"1" # unless it was already set to 1
EndSection

snazzify
Posts: 17
Joined: Fri Jul 29, 2016 4:49 am
Location: California, USA

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Mon Jul 31, 2017 4:40 pm

Thank you! Mine works great!

My only concern is the brightness, its a little too dark. Is there a way to adjust the brightness?

32teeth
Posts: 1
Joined: Tue Aug 29, 2017 4:14 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Tue Aug 29, 2017 5:54 pm

Anyone know how to change out the KeDei splash screen (blue background white font)
Image

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Fri Sep 01, 2017 11:44 am

32teeth wrote: Anyone know how to change out the KeDei splash screen (blue background white font)
Image
You must flash custom firmware with custom logo to memory chip which saper mentions in first topic. You probably must flash it via external programmer, or maybe I2C in HDMI (if it's connected to the chip on board) will works too (normally is used VGA I2C) (just grab some I2C programmer, HDMI connector and wire it). The source codes is the hard part, most of leaked source codes is unfinished, or they will return wrong binaries. But anyway, there is all found documentation about RTD2660/RTD2662 here: https://www.kolins.cz/share/RTD2662/ . Good luck ;)

EDIT: Maybe if that splash screen is a just bitmap, then just dump the raw firmware, change bitmap and flash it back.

User avatar
saper_2
Posts: 239
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Sat Sep 02, 2017 9:45 am

snazzify wrote:
Mon Jul 31, 2017 4:40 pm
Thank you! Mine works great!

My only concern is the brightness, its a little too dark. Is there a way to adjust the brightness?
I don't it can be done, u might try to play with resistor values around PT4103 but I'd not recommend because those backlight leds are probably working at their limits already.... But this is just my guess, I didn't hook up to them a oscilloscope so I can't tell anything for sure.
GAMELASTER wrote:
Fri Sep 01, 2017 11:44 am
You must flash custom firmware with custom logo to memory chip which saper mentions in first topic. You probably must flash it via external programmer, or maybe I2C in HDMI (if it's connected to the chip on board) will works too (normally is used VGA I2C) (just grab some I2C programmer, HDMI connector and wire it). The source codes is the hard part, most of leaked source codes is unfinished, or they will return wrong binaries. But anyway, there is all found documentation about RTD2660/RTD2662 here: https://www.kolins.cz/share/RTD2662/ . Good luck ;)

EDIT: Maybe if that splash screen is a just bitmap, then just dump the raw firmware, change bitmap and flash it back.
saper_2 (saper underscore 2) :P :P :P :P

The memory chip is a dataflash with SPI interface , so I think it can't be accessed via I2C from HDMI Actually it can be, on mentioned page there is a LPT-to-I2C_VGA adapter for flashing, but still quickest way would be desolder it, place into external programmer and dump it :D.
Maybe I'll do it - but much later I have a pile of "opened topics" that need to be closed :D
(e.g.: esp-32 with esp32-at firmware that don't work :/ , i2c programmer from RPi (reading works fine but write have issues...), esp8266 [email protected] with 128Mbit dataflash and micropython, 1wire toolbox, nexus 7 2012 hdmi-lvds display, pan-tilt wifi Pi0 camera, universal lcd (1bpp) controller on S1D13700 and S1D13705, wether station, ...)

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Sun Sep 03, 2017 9:50 am

saper_2 wrote:
Sat Sep 02, 2017 9:45 am
The memory chip is a dataflash with SPI interface , so I think it can't be accessed via I2C from HDMI Actually it can be, on mentioned page there is a LPT-to-I2C_VGA adapter for flashing, but still quickest way would be desolder it, place into external programmer and dump it :D.
Maybe I'll do it - but much later I have a pile of "opened topics" that need to be closed :D
(e.g.: esp-32 with esp32-at firmware that don't work :/ , i2c programmer from RPi (reading works fine but write have issues...), esp8266 [email protected] with 128Mbit dataflash and micropython, 1wire toolbox, nexus 7 2012 hdmi-lvds display, pan-tilt wifi Pi0 camera, universal lcd (1bpp) controller on S1D13700 and S1D13705, wether station, ...)
Well, I want to try it, but I not have any programmer. I want a buy one, but I don't know which one is good (price:quality ratio). Can you recommend me some good programmer? Thank you

User avatar
saper_2
Posts: 239
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Sun Sep 03, 2017 11:35 am

GAMELASTER wrote:
Sun Sep 03, 2017 9:50 am
Well, I want to try it, but I not have any programmer. I want a buy one, but I don't know which one is good (price:quality ratio). Can you recommend me some good programmer? Thank you
Personally, I'm interested in a Bus Pirate :D http://dangerousprototypes.com/docs/Bus_Pirate , but still didn't decided which version I should pick v3.x or v4 (comparison: http://dangerousprototypes.com/docs/Bus ... comparison) .
SPI programming can be done by flashrom (http://dangerousprototypes.com/docs/Bus_Pirate#flashrom) , for I2C - don't know but there must be a tool for it too .
I'm not in hurry to buy one because I can build a programmer using Atmel ATMega MCU and serial adapter :lol: - it cost me nothing because I have small "electronic warehouse" at home :P , and writing a bunch a lines to program eeprom in AVRStudio is simple for me.

U can check the Distributors of Dangerous Prototypes: http://dangerousprototypes.com/docs/Distributors , or get BP (bus pirate) from seeed studio: https://www.seeedstudio.com/ - v3.6 cost 27,2USD , v4 cost 37.2USD for today.


You can also use FT232 (single UART & GPIO with MPSSE ) / FT2232 (dual UART & IOs with MPSSE) / FT4232 (quad uart + IOs with MPSSE) - for those FTDIs chips there must exists programs for programming I2C and SPI memory chips . MPSSE stand for (from FTDI website):
Multi-Protocol Synchronous Serial Engine (MPSSE) to simplify synchronous serial protocol (USB to JTAG, I2C, SPI or bit-bang) design.
I used only few time MPSSE from FT2232 as JTAG programmer (jtag-lock-pick tool) for programmimg CPLD XC9536.

I googled for "FT232 I2C programmer" :D, and those 2 links got my attention :) - I didn't tested them, just those seems interesting :
https://sourceforge.net/projects/i2cprog/ & https://sourceforge.net/projects/ftdi-eeprom-gui/
Googling further for "FT232 SPI programmer" , lead me to again to flashrom https://www.flashrom.org/FT2232SPI_Programmer :D

Those 2 options for programing serial memories is what I' aware of (Bus Pirate and FT232), both are versatile tools, Bus Pirate seems to have everything in one, while for FT232 you need a right software to control it, both works on linux and windows so.... Hard to pick :lol: :lol: :lol:

Wheeww, this got a real off-topic :D

Ps. I'm personally in favor for BP v4 :P

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Sun Sep 03, 2017 12:30 pm

Thank you for recommendation. BTW. Matt Millman (author of ROVAtools - it can dump and burn firmware from RTD2660) was using FT232H from Adafruit: Image.

GAMELASTER
Posts: 38
Joined: Sat Feb 14, 2015 8:05 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Tue Sep 05, 2017 2:27 pm

Raspberry Pi Display
3.5 inch HDMILCD 18bit
version 1.1 2017/2/1
Image
Board layout looks like as 1.0 (Look compare gif)
Differences:
- The Flash memory is Winbond 25X40AL(it's looks like there is space)S31 (photo). AL series is older than CL series, also AL is not listed on Winbond official web pages.

Flash dump:
c501eb83693372e1089b096b024f2e9f (MD5)

Krot
Posts: 9
Joined: Sun Oct 08, 2017 3:08 pm

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Sun Oct 08, 2017 3:19 pm

Guys hello!
I have such a screen: https://cdn1.savepice.ru/uploads/2017/1 ... 2-full.jpg
How to install drivers and where to get them?
To make the screen work.

I go to Raspberry through remote access.
I just started to deal with it.
But I do not understand how to make the screen work (((

I connected it to the laptop, but there was no image on it.

User avatar
saper_2
Posts: 239
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

Tue Oct 10, 2017 5:23 pm

Krot wrote:
Sun Oct 08, 2017 3:19 pm
Guys hello!
Hi!
Krot wrote:
Sun Oct 08, 2017 3:19 pm
I have such a screen: https://cdn1.savepice.ru/uploads/2017/1 ... 2-full.jpg
This is KeDei HDMI .
Krot wrote:
Sun Oct 08, 2017 3:19 pm
How to install drivers and where to get them?
To make the screen work.
Did u read my Configuration post? viewtopic.php?p=1120534#p1120534
There is everything what is needed to setup this display on "Stock Raspbian" (no kedei kernels or whatsoever)
Krot wrote:
Sun Oct 08, 2017 3:19 pm
I go to Raspberry through remote access.
I just started to deal with it.
But I do not understand how to make the screen work (((
The bigger obstacle u solve by yourself, the more experience u gain :)
Don't forget to change the pi user default password... :)
Krot wrote:
Sun Oct 08, 2017 3:19 pm
I connected it to the laptop, but there was no image on it.
I hope U didn't connected only the hdmi cable (it need power too via microusb and it have a switch for turning on-off backlight - otherwise we'll have :lol: ). Also don't forget on laptop (in windows or whatever OS u have) to enable 2nd display (in Win7...10 it's WIN+P and select duplicate/extend/etc....)

Return to “HATs and other add-ons”