amzg
Posts: 6
Joined: Thu Nov 19, 2015 4:12 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon Nov 23, 2015 4:55 pm

New video, Besides Retropie also happens to me if I play a video or run a game, do not know why but I can't get on the TFT display directly.

https://www.youtube.com/watch?v=V9zPMNPliIY

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

Mon Nov 23, 2015 5:14 pm

BOiO - Thanks for sharing logs and some configurations files :) . I suppose you have already tried (in first place) with only lcd hooked up (HDMI disconnected at all). Show what you get of "ls /dev|grep fb" . But I think the problem you have, is originating from screwed injection of this kedei lcd driver in manufacturer kernel. btw. I found that shop in taobao too, but I can't contact him at all - when I see Chinese language, I see bushes without leafs :lol: , If you would manage to get touch with owner of this store (account on taobao) then could ask him for datasheet for lcd too :) .

Viiloribo - there is nothing done yet :D , I just received 74HC4040 and it will take few days before I do something actually (I just like to put thing on hold :lol: ).
Speed... don't know, maybe lcd will work faster (in theory should - because writing a one pixel will take not 8 or 6 bytes (if you get rid of zero-ing shift registers) but only 2 bytes shifted - so 3 to 4 times faster but this is theory).
I just want to make this lcd works under fbtft drivers and behave like normal fb device, not some crippled framebuffer where it take place of default video output and "just work".
If you look at my github repo, then you will find a original schematic (reverse engineered in `lcd-photos`), and next schematic (in `hw-hack`) with added modifications to fit fbtft driver. The modification requires:
  • remove U1 shift register, remove CS1 (CE1) from U2&U3-STCP,
  • connect mosi to U2-DS,
  • add 74HC4040 to clock line, add a NOT gate (1/6 of 74HC14 or 74HC1G14 :D ), and connect it to STCP U2&U3 & LCD /WR (assumed - LCD pin 36 either 38)
  • connect CS1 to LCD /CS (assumed pin 36 either 38)
  • add signals from RPi GPIO: /Reset (lcd pin 19) , D/C (Data/command) - LCD pin 37 (I'm quiet sure this pin)
  • LCD /RD (lcd pin 39 - is always kept high so this must be a RD) connect to V+ (+3,8V) by 100-200ohm resistor
And this need a rather good solder skills, especially :D - I soldering on my self-made pcb a chips with pin raster of 0,5mm :D so this is not a real challenge :D


--- edit ---
amzg & BOiO - show what you get on:

Code: Select all

ls /dev | grep fb
amzg
Try to set/change for omxplayer a `--display` parameter - might work. Or try `fbcp` - I found this: viewtopic.php?f=29&t=63133 .

BOiO
Posts: 3
Joined: Sun Nov 15, 2015 9:42 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon Nov 23, 2015 10:31 pm

in the first place i obviously tried to pull out the HDMI cable, but the result is the same..
unfortunately i can't create an account on taobao.com because it needs a special account with a chinese phone number (or similar :o )

my ls /dev | grep fb:


[email protected] ~ $ ls /dev | grep fb
fb0


but surfing on the net i found this command "fbset --verbose --info --show" and this is my result: http://pastebin.com/sab7zeSb

ps: i dont' know what i'm doing :lol: :lol:

amzg
Posts: 6
Joined: Thu Nov 19, 2015 4:12 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon Nov 23, 2015 11:23 pm

Thanks for the answers saper_2!!

The same results as BOiO .

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 Nov 24, 2015 7:34 pm

The problem you facing is coming from crappy injection of ili driver into kernel. Now I'm pretty sure that omx and retropi uses a direct access to gpu skipping framebuffer and display interfaces provided by kernel. Looking at options of omxplayer should be possible to force him to use display 0 (framebuffer 0 = fb0), use mentioned by my parameter.
As for retropi try asking in it's support forum, if is possible to use framebuffer device, not a direct gpu render (this is fastest way).

Or just consider this 3,5" lcd as junk,and buy 5" lcd with HDMI input.
I have bought one and I'm happy ;) , I had problem with touch panel and calibration but on my account in github I have repo with description how to calibrate touch screen.

nighowl2000
Posts: 2
Joined: Sun Mar 31, 2013 1:26 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Fri Nov 27, 2015 6:10 pm

Just to put it out there. I got this screen but it was Version 2. If you use the image file meant for Version 1, all your colors on the LCD will be inverted. I emailed the ebay seller and got the version 2 drivers from here:

3.5" Touch Screen LCD Driver V2.0
https://drive.google.com/file/d/0B6yht2 ... sp=sharing

Works perfectly with the new pi2!

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 Nov 29, 2015 3:36 pm

Hi,

I looked throughout the diff from files in nighowl2000 post. Init is different, some parts are same, some are removed, some are added, manufacturer might changed a lcd module, with some very similar clone of ili9481 (or alike).
Both versions have that same commands ( & params) for setting window:
  • 0x2b - set page address, params: start_msb, start_lsb, end_msb, end_lsb - end set to: 0x01 and 0x3f = 0x013f (319dec)
  • 0x2a - set column address, params: start_msb, start_lsb, end_msb, end_lsb - end set to: 0x01 and 0xdf = 0x01df (479dec)
  • 0x2c - write memory start
I looked at fbflex code from rpi kernel sources, but this does not support set_window_address for ili9481 (9486/etc), so I need to create new module :) (based on ILI9481 code) , but here are some photos of hw hacked lcd already :) :
github:saper-2/rpi-spi-lcd35-kedei/hw-hack/
Image
Image

For soldering I used RMA-7 flux so I don't need to clean it :) ,

On code I will work.... I think in this week :lol:

Viiloribo
Posts: 2
Joined: Sun Nov 22, 2015 11:15 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Mon Nov 30, 2015 12:23 pm

saper_2 Great !! :) ! I also tried your hack-mod! and I could not use the display , with a set of fbtft ilitek 93xx, 94xx series !! :( It would be great if you 'd got it !!!

P.S hearing from you news :) ) )

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

Mon Nov 30, 2015 8:33 pm

Viiloribo wrote:saper_2 Great !! :) ! I also tried your hack-mod! and I could not use the display , with a set of fbtft ilitek 93xx, 94xx series !! :( It would be great if you 'd got it !!!

P.S hearing from you news :) ) )
So, here is the News :D :

[email protected] - don't work, tested.
[email protected] - WORKS :D

Youtube movie of [email protected]: https://youtu.be/wGVt_bYuE5g

Basically, I kicked out '595, and in their place I soldered '4094 (not literally, their pinout does not match at all, so there is a lot of wires :D)

Now, I have to do some testing (actually hookup console to new framebuffer and see if this works), and when I sort out things (schematic - I [email protected] this with datasheets of chips and fbtft spi interface schematic, and right now everything is still in my head :D). One more hint, CS and WR signals are need to be swapped (according to my assumptions in [email protected]).

Maybe today I manage to update my repo https://github.com/saper-2/rpi-spi-lcd35-kedei with schematic and photos :) - if not today then in few next days :)

amzg
Posts: 6
Joined: Thu Nov 19, 2015 4:12 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Wed Dec 02, 2015 6:40 pm

@saper_2 good work!!!

I think the best option is to buy a screen with hdmi XDDDD

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 Dec 02, 2015 11:19 pm

Mehehehe, I have already 5" one :D Even I added to "python uinput driver" calibration , you can find it in my repos on github :D .

Well, screen worked for about few hours then I rebooted pi and everything got f*** (I think I made a short and one out of '4094 gone bad...). I'm thinking on sending to pcb manufacturer a prototype pcb with fbtft spi interface so I can just wire up this adapter to lcd :)

Anyway I have updated repo and I'm hitting bed...

User avatar
georgeuhm
Posts: 2
Joined: Tue Dec 15, 2015 5:37 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue Dec 15, 2015 6:13 pm

I am new to Linux and Raspberry Pi and I have this exact same LCD model.
Because I did not understand what to do with the *.img file, how to write it to my SD (would it delete my Noobs instalation?), I just downloaded the LCD_show folder directly on my Pi and renamed LCD35_v1 and gave it *.sh extension. (Did not know about the other 2 files ILI9341.c and the patch, before finding you - I also don't know how to run or install them.)
Now I have a screen with inverted colors. :oops:

From what I understand, you hacked your display. But if you ever get a new one (the same model), please consider making a tutorial for installing the screen as it is.
You are awesome, thank you for your work!

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 Dec 15, 2015 9:25 pm

georgeuhm
You write img to the card as normal raspbian image (google how to do this), and yes this will destroy content of card. you run in the folder lcd_show a bash script (you need to "chmod +x [the-script-file-name]" it first, then run as root "sudo [the-script-file-name]") BUT, the precompiled version is a quiet old so don't expect that it will work normally (there is quiet possible there will be a "glitches" - not to mention missing modules....). The safest way to use this lcd is flash prepared image to sd and then set-up environment, but DO NOT UPDATE KERNEL (apt-hold .... - don't remember which packages to hold) or disp stop working :)

Yes I did :) for now I thinking about ordering prototype pcb's of spi adapters from seeedstudio (cheap).

Inverted colors - check post nighowl2000 viewtopic.php?p=850931#p850931 he share link to working sys image for v2. I think I remember seeing there instructions how to burn img file too and how to hold some raspbian updates...

ps. sorry for my English, I have typed this post fast :)

kdbdallas
Posts: 5
Joined: Tue Dec 15, 2015 10:29 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Tue Dec 15, 2015 10:38 pm

MunhozThiago, you talk about being able to have the LCD and HDMI working at the same time.

Would you be willing to share the custom firmware/kernel that is needed to make this possible, or if it something simpler, even better,

Thanks in advance!

User avatar
georgeuhm
Posts: 2
Joined: Tue Dec 15, 2015 5:37 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Wed Dec 16, 2015 4:40 pm

saper_2 wrote: Inverted colors - check post nighowl2000 viewtopic.php?p=850931#p850931 he share link to working sys image for v2. I think I remember seeing there instructions how to burn img file too and how to hold some raspbian updates...
IT WORKS!!
I left my Raspbian instalation, just copied the LCD_show and ran the commands from LCD35_v2
I just needed the V2 archive, thank you again !!

PS u'r english was perfect for what i needed :D

vmed
Posts: 3
Joined: Thu Dec 24, 2015 5:39 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Thu Dec 24, 2015 7:10 pm

Hello greetings. First say that I have knowledge and electronic studies but am new to this platform. I have purchased a LCD like this and I installed the image that comes to software. Display lit but no definition and colors are not suitable. It lacks the red. I tried to install the various manually but will not let me copy and paste the micro itself. I read a lot of tutor to them but no longer if different problem or defect of the LCD. I have a raspberry pi2. I have this same lcd Ali. I would appreciate some help. 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 Dec 25, 2015 12:20 pm

vmed
Sorry, about 95% people reading your post won't understand it... I felt like I was reading a message from Chinese sellers who use google translate.
I got this:
- your lcd missing red color
- you using rpi2
- you have electronic knowledge (so you know to not insert nail into socket on wall :D )

Which version of lcd module do you have? (v1.1 , v2 ?)
If you use kernel for v1 on v2 lcd then colors will be inverted (or something like that) and back (v2 kernel on v1 module).

I think seller gave you v1 kernel while sending v2 module (this problem had georgeuhm too).

vmed
Posts: 3
Joined: Thu Dec 24, 2015 5:39 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Fri Dec 25, 2015 5:44 pm

Hello, the LCD module that sent me is v 3.0 dated 5 December 2105. The image file downloaded from the page of the seller is the v 1 release but have tried not v 2 also works. I have to use the Google translator to write in English because my language is Spanish. But if you prefer to write in Spanish. I use the method of modified image file that when trying to do with the manual method for usb tells me that there is not enough space in the micro usb and is 16 gb. Follow the instructions for the seller. Thank you

zefj
Posts: 1
Joined: Sat Dec 26, 2015 12:41 am

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sat Dec 26, 2015 12:49 am

Hi. This is hardly related to saper_2 glorious hacking attempts, but it is the first result in Google Search regarding this LCD, so I've decided to post here.

To anybody who has a version 2 screen and does not want to use the kernel provided by the manufacturer, please refer to my post on how to compile a custom kernel with V2 screen support.

http://frec.pl/blog/compiling-custom-ra ... -kedei-35/

vmed
Posts: 3
Joined: Thu Dec 24, 2015 5:39 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sat Dec 26, 2015 5:35 pm

Fixed, problem drivers. The seller sent me the correct drivers. Thank you

User avatar
hansotten
Posts: 324
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Dec 27, 2015 4:03 pm

zefj wrote:Hi. This is hardly related to saper_2 glorious hacking attempts, but it is the first result in Google Search regarding this LCD, so I've decided to post here.

To anybody who has a version 2 screen and does not want to use the kernel provided by the manufacturer, please refer to my post on how to compile a custom kernel with V2 screen support.

http://frec.pl/blog/compiling-custom-ra ... -kedei-35/
Thank you!
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

User avatar
impshum
Posts: 2
Joined: Wed Aug 13, 2014 11:42 am
Location: UK
Contact: Website

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Sun Dec 27, 2015 4:11 pm

I got one the other day and it was a v3. I installed Jessie and used the drivers the seller kindly gave me. I uploaded it here for future use: https://mega.nz/#!hhdCTCDZ!UXyyh17uZo3p ... fx9-zqoGj0

Instructions from the seller (not in Engrish) were:

copy over the drivers to your pi (preferably to /home/pi)
unzip LCD35_show_v3.zip
cd LCD35_v3
sudo ./LCD35_v3

What this does is copy over a new kernel and the drivers then reboots.

When you update the system:
sudo apt-mark hold raspberrypi-bootloader
sudo apt-get update
sudo apt-get upgrade

Works a charm.

Image

riskman
Posts: 1
Joined: Wed Jan 13, 2016 12:16 pm

Re: KeDei 3.5 inch 480x320 TFT lcd from ali

Wed Jan 13, 2016 12:27 pm

Hey,
Everything is working fine ! But how can i turn HDMI mode back, if i want to use from time to time this mode ? Pls help ! :?

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 4:02 pm

Good morning. Everything worked perfect. However , it works fine in console mode. If I use the " startx " command to the GUI , launch a series of errors. And by pressing Ctrl + Alt + F7 to go to the graphical interface , it is in black screen with the cursor in the upper left corner and not allowed to do anything more .


HELP ME!!!!

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 6:14 pm

Hi,

First thing: write you question once. Duplicates were reported.
Next, we don't have a crystal ball so we don't know what errors you get. Provide some logs, if you don't know what/how then at least ask politely how to/what.

Stripping off your cries, I guess xserver don't like kernel from v3... Are you rpi up to date?

----------------- to the main topic ([email protected] lcd ) :) -----------------
I didn't close project with interface :) but I have to postpone it for a some time, because I have to spend (save and spend) money for more important things.

I have spent a lot of time on those lcd, the interface to lcd is just a crap. Pre-build kernel as "driver" (right now in many pockets open a knife on this term :D) and disabling update of firmware because kernel (aka "driver") stop working - my comment on this is not for public because of "harsh words" ;)

Great idea, good size and resolution but realization - aaaaghhhh...... This could be a very cool display only if the interface was not f**** .

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