eduarchap
Posts: 8
Joined: Tue Dec 29, 2015 9:52 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Jan 14, 2016 6:47 pm

Hi.

Can resolve the problem by reinstalling the xorg with apt- get install xorg --reinstall .

The raspberry began operating and displays the desktop . However , I think the disabled USB ports , as the mouse and keyboard are connected unusable after you start the graphical interface.

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

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Jan 14, 2016 7:23 pm

Hi,

SSH to you rpi, unplug your mouse+kbd and plug it back and then check dmesg ( dmesg|tail -30 ) and see if your kbd&mouse are enumerated (should be, otherwise lan won't work either).
I think something you have wrong with input config for X (or you don't have any usb input devices setup in config files).
I think this is the file:

Code: Select all

/usr/share/X11/xorg.conf.d/10-evdev.conf
And the content from clean raspbian:

Code: Select all

#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection
Check also other conf files, maybe you'll find there something.

eduarchap
Posts: 8
Joined: Tue Dec 29, 2015 9:52 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Jan 14, 2016 7:30 pm

Hi.

Unplug and plug again, after execute dmesg|tail -30... return

[email protected]:/# dmesg|tail -30
[ 5.287837] systemd-udevd[95]: starting version 215
[ 5.288194] systemd[1]: Mounting Configuration File System...
[ 5.313869] systemd[1]: Starting Syslog Socket.
[ 5.323324] random: nonblocking pool is initialized
[ 5.333569] systemd[1]: Listening on Syslog Socket.
[ 5.333927] systemd[1]: Starting Journal Service...
[ 5.346883] systemd[1]: Started Journal Service.
[ 6.260531] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 6.985398] systemd-journald[100]: Received request to flush runtime journal from PID 1
[ 7.910389] Adding 102396k swap on /var/swap. Priority:-1 extents:5 across:1929212k SSFS
[ 8.607393] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 10.029656] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x51E1
[ 2260.684282] usb 1-1.3: USB disconnect, device number 4
[ 2261.708441] usb 1-1.5: USB disconnect, device number 5
[ 2263.739322] usb 1-1.4: new low-speed USB device number 6 using dwc_otg
[ 2263.844659] usb 1-1.4: New USB device found, idVendor=046d, idProduct=c077
[ 2263.844685] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2263.844703] usb 1-1.4: Product: USB Optical Mouse
[ 2263.844719] usb 1-1.4: Manufacturer: Logitech
[ 2263.851973] input: Logitech USB Optical Mouse as /devices/platform/bcm2708_usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C077.0004/input/input4
[ 2263.853312] hid-generic 0003:046D:C077.0004: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-bcm2708_usb-1.4/input0
[ 2266.809603] usb 1-1.2: new low-speed USB device number 7 using dwc_otg
[ 2267.017958] usb 1-1.2: New USB device found, idVendor=04d9, idProduct=1603
[ 2267.017984] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2267.018002] usb 1-1.2: Product: USB Keyboard
[ 2267.018018] usb 1-1.2: Manufacturer:
[ 2267.067584] input: USB Keyboard as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:04D9:1603.0005/input/input5
[ 2267.119982] hid-generic 0003:04D9:1603.0005: input,hidraw1: USB HID v1.10 Keyboard [ USB Keyboard] on usb-bcm2708_usb-1.2/input0
[ 2267.202407] input: USB Keyboard as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:04D9:1603.0006/input/input6
[ 2267.260124] hid-generic 0003:04D9:1603.0006: input,hidraw2: USB HID v1.10 Device [ USB Keyboard] on usb-bcm2708_usb-1.2/input1

mgrondona
Posts: 2
Joined: Thu Jan 14, 2016 11:30 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Jan 14, 2016 11:33 pm

Hello everybody,

Finally, is there any way to make this screen works a bit faster? I bought it because I wanted to play some videos, but it's imposible...

Thank you

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

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Fri Jan 15, 2016 11:07 am

Hi,

eduarchap - check files in pointed directory, the one I attached should be there unmodified in your install. If you have that file and it is identical then I have no clue why kbd&mouse don't work for you...


mgrondona - depends on your electronic skill. This lcd module could be a nice and fast one, only if the manufacturer didn't screw up spi interface.... So basically until you [email protected] this lcd module spi interface to fbtft-spi circuit interface you won't go faster than those 10-15fps.
In fbtft you send just 2 bytes per pixel and you update whole screen in one transaction sending 307200bytes (480px*320px*2 bytes(16bit color)=307200). Transaction is asserting CS at begin, and deasserting at end of data transmission.
While kedei interface requires a 2 transactions by 4 bytes each just for one pixel: one for prepare lcd to store pixel data and drive control lines, and 2nd for "save" pixel data - with this you have to do 307200 transactions where each have 4 bytes - so which is faster :) sending whole screen in one transaction or in 307k transactions?
Performing each transaction take some time for kernel (this is normal kernel not for fast access of I/O hardware (like linux-cnc kernel)), there is also need for some time slot to read touch controller status which is on SPI bus too.

muelli
Posts: 60
Joined: Sat Jul 21, 2012 12:16 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sat Jan 16, 2016 12:11 pm

Hello saper_2,

does the final hack work permanently?
is there a schematic somewhere on how to modify the v2 display? I just saw your pictures und going from there is kind of difficult :)
How fast is the display with the fbtft driver? Did you run a test?

thanks!

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

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sat Jan 16, 2016 9:39 pm

muelli - thanks for interest.
On my github repo: https://github.com/saper-2/rpi-spi-lcd3 ... -hack/v2.1 , you will find schematics, pcb's drawings, etc. This was working for eeee..., about 30min :D then I accidentally made a short from usb port chassis to one of chips and it stopped working (I forgot that usb chassis can make short under lcd module :roll: ).

As for working, it works like any other fbtft screen just you need to adjust init to v2 (or v3) . There is a manufacturer driver code for v2 so just take init from there.

For lcd module v2 schematic is identical only thing that is different, is the LCD FPC different signal layout. But signals to LCD FPC from U1,U2,U3 are kept unchanged. So if you solder to U1,U2,U3 pads from shift register and control signals then it must work.

I'm going to make a pcb for spi-fbtft interface, but pcb is two-sided (this way pcb is smaller, I have one-side design but it requires few extra wires/jumpers...) so I have to order from pcb manufacturer a prototype series of this pcb... Ahh, I think I forgot to mention on github, set JP1 to 16bit :)

muelli
Posts: 60
Joined: Sat Jul 21, 2012 12:16 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Jan 17, 2016 10:49 am

OK I found the schematic....

>>For lcd module v2 schematic is identical only thing that is different, is the LCD FPC different signal layout. But signals to LCD FPC from U1,U2,U3 are kept unchanged. So if you solder to U1,U2,U3 pads from shift register and control signals then it must work.

What is FPC?

>>I'm going to make a pcb for spi-fbtft interface, but pcb is two-sided (this way pcb is smaller, I have one-side design but it requires few extra wires/jumpers...) so I have to order from pcb manufacturer a prototype series of this pcb...

Do you have eagle brd or schematics? Would be easiest to make my own pcb then.

>> Ahh, I think I forgot to mention on github, set JP1 to 16bit :)

What JP1? Again, no clue :)

THanks :)

PS: Did someone manage to get ts_calibrate working?
Despite setting the env variables to fb1 / event0 the calibration tool is not reacting to input/toucing the crosshairs....

PS2: Forget the PS line. I used xinput_calibration that worked perfectly.

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

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Jan 17, 2016 1:13 pm

muelli wrote:OK I found the schematic....
Gooooood :)
muelli wrote: What is FPC?
https://en.wikipedia.org/wiki/Flexible_electronics - this "yellow-orange" part of lcd (you can see it at my photos of "un-glued" lcd from pcb) that have pins and is soldered to PCB.
muelli wrote:Do you have eagle brd or schematics? Would be easiest to make my own pcb then.
I use only AD and in work sometimes kicad
muelli wrote: What JP1? Again, no clue :)
Check schematic.
muelli wrote: THanks :)
U're welcome :)

bigbone
Posts: 2
Joined: Tue Jan 19, 2016 11:14 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue Jan 19, 2016 11:41 am

Hello.

I am also fairly new to Raspbian. I did one media center(OSMC) project with my first RPi2, but that was fairly easy. This one get me to scratch my head a lot in finding answers to problems...

1. How do I get to configure the 240x320 resolutioin?
2. Is there a way to simultaneously use the touchscreen LCD and HDMI?

i know these things are discussed on this thread but i have been backreading all the posts but could not get it to work. any pointers would be highly appreciated!

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

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue Jan 19, 2016 6:13 pm

bigbone wrote:1. How do I get to configure the 240x320 resolutioin?
Heeeee? Where, what, on what, etc... Well, I don't get you...
bigbone wrote:2. Is there a way to simultaneously use the touchscreen LCD and HDMI?
Yep = yes, you just need lcd compatible with fbtft kernel driver. That's mean no "KeDei" lcd will ever work with fbtft and users are sentenced to use an old kernel 4.1.12 ...
bigbone wrote:i know these things are discussed on this thread but i have been backreading all the posts but could not get it to work. any pointers would be highly appreciated!
None of us don't own a crystal ball so we don't know what lcd module you have. Each version have different driver (different thing is only lcd init sequence - but well let's call it driver).

The "driver" captures a default kernel framebuffer (which should be directed to gpu, and from gpu to hdmi or cvbs) and "send" it to small lcd, driver also tell kernel graphic system that it have resolution of 480x320 and 16bit color.
The X-server (and lightdm - desktop manager) and tty's (linux consoles) are using a default /dev/fb0 (framebuffer 0) kernel device (which is redirected to small lcd), while the software that using directly a GPU of BCM processor can display on hdmi display, because it talk directly to GPU bypassing kernel framebuffer.

So, because of ugly (and dirty) way doing the capture of framebuffer it is impossible to normally use hdmi and lcd module, there is a big issue with with the interface too, which is just so f*** slow, I don't know what spi clk frequency is used, but I assume ~31MHz because it the fastest that I could test.

SO I did some math to give picture how "slow" the kedei is :) :
- lcd have 480x320px 16bit color that gives: 480*320=153600 pixels to update, 16bit color give 2 bytes per pixel.
- to write a word (16bit=2bytes= 1 pixel) you need to send on spi at least 3 bytes twice - the driver sends 4 bytes. Why twice: because the control lines are driven from one of three shift registers, and you have to toggle WR (WR-write control, and CS-chip select) line twice to make lcd controller store pixel color.
- So for one pixel you send in two transactions total 8 bytes.
- If SPI runs at 31.25MHz divide it by (8bytes*8bit)=64bit that give you "pixel clock" (how fast pixels are updated), and this is 488281Hz
- divide 488281Hz by lcd total pixel count: 488281/153600=3,17Hz so basically this LCD have about 3fps , this excludes transmitting commands to lcd controller and time for handling touch controller, also beginning and ending each transaction take some time...
As for fbtft:
- SPI 31.25MHz, LCD have 153600px
- because of a much better designed SPI-to-parallel interface, fbtft need for one pixel only 2 bytes to be sent over SPI, WR lcd signal is handled by hardware
- that give: 31,25MHz/16bit(2bytes)=1953125Hz almost 2MHz "pixel clock" (compared to 488,2kHz)
- 1953125/153600px = about 12fps but by test done by notro the main author of fbtft driver he was able to even get a 26fps...
- the SPI CS only resets interface, so whole screen is updated in one transaction - next "+" why I want to re-interface my lcd to work with fbtft
:ugeek: :ugeek: :ugeek: :ugeek:

Now your brain can be compared to scrambled eggs :lol: :lol: :lol: :lol:

mgrondona
Posts: 2
Joined: Thu Jan 14, 2016 11:30 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue Jan 19, 2016 8:13 pm

Can we do something to use the screen at [email protected] (colour depth)? I tried modifying /boot/config.txt but it doesn't work, boots at 16bit mode.
I'm sorry I'm new...

Thank you.

bigbone
Posts: 2
Joined: Tue Jan 19, 2016 11:14 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue Jan 19, 2016 9:32 pm

Thanks saper_2.. .

I just need to pick-up my brain that just blew into peices there. This LCD is just rubbish. My instructor bought it on ebay without checking if its supported my notros firmware. Sorry about the 1st question, i was either drunk or just dozing off tired figuring out how to make it work. It does work with the 4.1.12 kernel i've used.

At first glance i thought it was using a different aspect ratio because i could not see the whole windows in that small screen and icons were overlaping on the panel.

LAST QUESTION. What do I have to do to at least switch between HDMI and LCD?

Thanks again!

OttoHermansson
Posts: 1
Joined: Sat Jan 23, 2016 3:36 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sat Jan 23, 2016 4:34 pm

If anyone needs version 4 or any other version for that matter it is available here direct from KeDei. However the site was a bit slow for me so I'll include a dropbox link as well to the v4 file too. https://dl.dropboxusercontent.com/u/218 ... _v4.tar.gz


http://pan.baidu.com/s/1i4cKsF7#path=%2 ... 35_inch_ts

duelago
Posts: 1
Joined: Sat Jan 09, 2016 10:08 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Jan 28, 2016 2:16 pm

Hello gurus,

I have version 3 up and running with the drivers from the vendor.

Question: Is it possible to turn the display off by any method?

I want the Raspi to keep on running, but it would be nice if my bedroom with the LCD goes dark when I need my beauty sleep :roll: :roll:

Blue Skies,
/David

w.mo
Posts: 4
Joined: Wed Feb 10, 2016 4:40 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Wed Feb 10, 2016 5:31 pm

saper_2
Hi! I have found a blog from a guy who does similar work:
http://tutorials-raspberrypi.de/lcd-tou ... pberry-pi/
It's in german though. If you think you can use it I can translate it to support your work.

Thx so far!

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

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Feb 11, 2016 8:47 pm

w.mo wrote:Hi! I have found a blog from a guy who does similar work:
http://tutorials-raspberrypi.de/lcd-tou ... pberry-pi/
It's in german though. If you think you can use it I can translate it to support your work.

Thx so far!
He did what I did but with different lcd - idea is that same . He also manage to make touch works - I think I'll copy it from him :D .
Maybe on weekend I'll make order in seedstudio fusion pcb service and order few pcb's with interface.

w.mo
Posts: 4
Joined: Wed Feb 10, 2016 4:40 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Fri Feb 12, 2016 11:21 am

Okay :D ill definitely copy yours when it all worked out!

xlanda
Posts: 5
Joined: Sun Feb 14, 2016 11:48 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Feb 14, 2016 2:35 pm

Thank you OttoHermansson , that is what I was needing.

What is the website address of the manufacturer where this driver can be found?

I tried desperately to find the drive or the manufacturer, but did not find any information, but thanks God I found it here. :D :D

Thanks again

masterjon
Posts: 4
Joined: Thu Feb 18, 2016 3:45 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Feb 18, 2016 3:49 pm

I am having huge troubles trying to get this thing to work, can somebody tell me EVERYTHING they had on their sd card to get this to work and where they got it. I have a version 3.0 and my computer is a windows 8.1 and my pi is a B+. I really do not care what the operating system is all I really want this to work with is python and such... Please, your my only hope!!!

Higgs
Posts: 43
Joined: Tue May 26, 2015 2:17 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Fri Feb 19, 2016 4:46 pm

No - Obi-Wan Kenobi is your only hope. :D

For your Kedei v3 you can look in the description in this link

http://www.amazon.com/OSOYOO-480x320-Di ... 3.5%22+tft

or you can TheGoogle LCD_show_v3 (ends up at a Baidu site I think).

User avatar
mikronauts
Posts: 2720
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Fri Feb 19, 2016 4:59 pm

I don't have this LCD, but the following google search

https://www.google.ca/?gws_rd=ssl#q=KeD ... 80x320+TFT

has a lot of results that look promising.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

masterjon
Posts: 4
Joined: Thu Feb 18, 2016 3:45 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue Feb 23, 2016 8:53 pm

Ok, this still isn't making sense to me. Can somebody post a video of the whole process of what they did with a totally blank sd card? this would help so much for me. Please

User avatar
idontcar3
Posts: 8
Joined: Wed Mar 09, 2016 2:54 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Wed Mar 09, 2016 3:25 am

Hello all :)
Thanks saper_2 for your hard work, i love your hardware hack :D
Thanks everyone for all the resources linked to this thread, has served me to investigate about my new acquisition (rpi3 + Kedei 3.5" v3 screen).

I'm here with a question in mind (i just registered for this, and because i'm getting my first pi):
Would be possible to use berryboot using this screen?
idk... i'd like to have a multi system pi but i'll be having this crapy cheap screen.

i'm thinking that won't be possible, because of the driver issue but i'm asking to see if anyone can try it (i'm getting my pi in 3 or 4 weeks). :roll:

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

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Wed Mar 09, 2016 5:07 pm

[/quote]
idontcar3 wrote:Hello all :)
Hello :)
idontcar3 wrote: Thanks saper_2 for your hard work, i love your hardware hack :D
Don't thank me before I'm done :D - I'll get lazy :P
idontcar3 wrote: Thanks everyone for all the resources linked to this thread, has served me to investigate about my new acquisition (rpi3 + Kedei 3.5" v3 screen).
Well, we still hunting (or only me?) for v3 kernel patch (for source) or driver code - I'm interested in init seq.
idontcar3 wrote: I'm here with a question in mind (i just registered for this, and because i'm getting my first pi):
Would be possible to use berryboot using this screen?
OK, I had to google what is berryboot :roll:
idontcar3 wrote: idk... i'd like to have a multi system pi but i'll be having this crapy cheap screen.

i'm thinking that won't be possible, because of the driver issue but i'm asking to see if anyone can try it (i'm getting my pi in 3 or 4 weeks). :roll:
I just ordered Pi3 from local shop (from shop from my country but I overpaid about 10€ :evil: ) - I'm curious of Pi3 WiFi and BT :) .

Let me spell this for you ;):
This CRAPPY screen should work out of the box with Pi3 but there is always but :)

Back to the berryboot - it is possible (nothing is really impossible :) ) but authors/developers had to include into berryboot fbtft or import and built-in into berryboot driver from patches for displaying and driver for touch. If you sum how much work need to be done you'll get to conclusion that it's not worth of wasting time. But, well that's my opinion.

About those KeDei lcd's, I'm thinking about to hook lcd up (temporally) to GPIOs directly and try to read ID register from display - I want to check what kind of TFT controller have those displays , because when I've been checking the init code against datasheet - commands nor parameters didn't match up. I recently found out, that the ILI-like tft controllers have "undocumented init commands"... So, I would like to verify what kind controller have those displays (those I have).
This inspired me to check what those lcd have controllers" http://www.microcontroller-project.com/ ... o-uno.html

And I remembered that, I have to order some PCBs :lol:

Return to “Interfacing (DSI, CSI, I2C, etc.)”