kedei 3.5 inch tft lcd display spi with touch screen quotation

While googling for any info about lcd controller I came across this page: http://heikki.virekunnas.fi/2015/raspberry-pi-tft/, author managed to get from manufacturer patch file for kernel sources and tested it with 4.1.y - on which lcd worked. But still LCD replace HDMI, but I want to use this screen as additional for user interaction, while the bigger on HDMI as presentation monitor.

Since, fbtft has been merged with rpi kernel, so the fb drivers (including ili9341.c) was moved to fbtft_device driver (so the author of page can"t compile latest kernel with driver+patch).

So something about hardware, which I reverse engineered by the "hard way" - "grab multimeter and run through all LCD FPC pins and shift register pins"

Now I noticed there is "9486L" which can suggest that LCD screen is controlled by ILI9486L, I found this LCD on taobao too but I can"t contact seller.

I"m pretty sure about D/C (Pin 37 on LCD) and Reset (Pin 19 on LCD) pins by looking into driver code, but I can"t identify other signals (WR/RD/CS/etc...)

[ 4.838806] input: MOSART Semi. Rapoo 2.4G Wireless Touch Desktop as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:24AE:1000.0001/input/input1

[ 4.862704] hid-generic 0003:24AE:1000.0001: input,hidraw0: USB HID v1.10 Keyboard [MOSART Semi. Rapoo 2.4G Wireless Touch Desktop ] on usb-bcm2708_usb-1.3/input0

[ 4.902783] input: MOSART Semi. Rapoo 2.4G Wireless Touch Desktop as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.1/0003:24AE:1000.0002/input/input2

[ 4.926400] hid-generic 0003:24AE:1000.0002: input,hiddev0,hidraw1: USB HID v1.10 Mouse [MOSART Semi. Rapoo 2.4G Wireless Touch Desktop ] on usb-bcm2708_usb-1.3/input1

- Controller is not ILI9341/ILI9325 - those are for smaller displays (320x240, etc...), I guess this might be ILI9486/9488 because they are for 480x320 displays. But when I compared init with DS it does not fit right so LCD can have a clone of ILI9486/9488 ...

- Module use only SPI interface and two CE signals (CE0 for touch controller, CE1 for LCD shift registers - compared to others lcd modules, in KeDei module this is swapped),

kedei 3.5 inch tft lcd display spi with touch screen quotation

When surfing for information on 3.5 ” TFT touchscreens for the Raspberry Pi,to improve the TinyLCD experience, I stumbled upon AliExpress where several shops offer a 3.5″ LCD TFT Touch Screen Display for incredible low prices.

Here my experiences with the screen: quite slow refresh, not too high contrast, crisp screen, touch works, software works but is already outdated, but considering the price this screen is well worth the money! If I compare it to the NeoSec screen it is a better deal for applications with a high contrast theme and no demand on smooth video.

So now for the test. On the sellers page an URL is placed to get the software, on a Google drive. Not a clickable url, but an image with a long filename to type over …. Oh well, I got the archive.

Update June 2016: There is now a download/information page at http://osoyoo.com/driver/rpiscreen.php. Images for more versions (mine i 2.0, latest is 6.2)  are available there. Alternative ishttp://kedei.net/raspberry/raspberry.html with Kali Ubuntu drivers too for version 3.0 and up.

The archive contains an image of Raspbian with the LCD driver installed. The image is quite current, and fit for B, B+ or 2 B. When I bought the screen an older image, build in augustus 2015,  was downloadable, the kernel is quite fresh built, early October 2015.

The image supplied is wheezy,  3.18.9-v7 #27 SMP PREEMPT Sun Oct 4 23:57:41 CST 2015 armv7l. So quite a recent system! Also the Model 1 B and B+ kernel is present, also just current wheezy.

Now the bad news: no word how these kernels were build. So we are stuck with wheezy for now until the Chinese supply a more current build, hopefully based upon jessie. Until then: be careful updating the system by holding back on kernel updates.

The system uses SPI to copy the screen contents to the LCD screen, and some GPIO’s for the touchscreen. Other GPIOs are free, and the connector construction  leaves these pins indeed accessible!

kedei 3.5 inch tft lcd display spi with touch screen quotation

I"ve gotten the level converters now, and experimented a little, with no results but a plain white screen. I copied the "init commands" code from the Linux source for ILI9341, which are the closest thing I could see in the patch made by KeDei for any init-code, plugged an arduino Uno in via a level converter from 5v down to 3v3, with SCK/MOSI/MISO from arduino pins 13/12/11, and pin 9 to toggle L_CS, keeping it HIGH but pulling it LOW for 1 to 5 milliseconds after each 4-byte SPI write.

Eventually I tried without the level converter too, since the 74HC595 datasheet said it could handle "up to Vcc" on the input pins, Vcc being max 6V. But that was after trying a lot of combinations in the code; all the variations of SPISettings in Arduino"s SPI library, for transferring four bytes one at a time (someone else who also looked at these displays found out that the registers always want four bytes - and that the first byte is always 0x0 !). Also doing as you suggested with an extra "DC command bit" so that the "bytes" were 9-bits wide, ending in a zero bit to indicate "command". No luck, ah well.. And I can"t even be sure that either the display is an ILI9341 just because the sales page said so (others had gotten similar displays with another drive chip), or that the code in the kernel source matches this KeDei-version of the display.

As an amusing side note: I did get a Mega screen that I mentioned elsewhere, that only output blue colour, but yellow/red when told to "invert screen". It turns out the display is probably okay, but the interface is only 8 bits wide while the chip is set to 16 bits, meaning the last half of the colour data never makes it to the controller! That seems like a likely explanation to me, given the dirt-cheap price.

kedei 3.5 inch tft lcd display spi with touch screen quotation

I am working on simulators of point of sale devices using Arduino Uno and ATmega 2560. This application would be fine with this touch screen display as what I need is some way of simple data entry to change settings, display settings to the user, and provide a way to trigger some events.

Unfortunately when using this display with an Arduino Uno and the original KeDei TFT library, there is very little memory available for storing data due to the small amount of memory on the Arduino and the large character font array in the KeDei library in file KeDei_font.cpp. However the touch interface seems to work with the Arduino.

The ATmega 2560 has much more memory and I was planning to use an ATmega 2560 instead of an Arduino Uno however I have run into a problem with the touch interface providing incorrect touch points when using the TFT display with the ATmega 2560. I have set the jumpers on the back of the display to 2560 however I"m still seeing incorrect touch points returned.

I have cloned the Osoyoo KeDei TFT library into my GitHub repository and have been working with the library. I have made a change to the 16x16 bitmap font table const unsigned char font16_B[95][16] in file KeDei_font.cpp of the KeDei TFT library to use an 8x8 bitmap font and to also eliminate lower case letters. This change has made a significant improvement by reducing the amount of memory consumed by the KeDei TFT library.

I have since found a font with smaller, 5x7 bitmaps, so the font table is now const unsigned char font_table[59][5] which requires me to use upper case only but really improves the amount of memory I have available. I"ve also modified the library to do scaling of the font to double wide or high or to triple wide or high.

kedei 3.5 inch tft lcd display spi with touch screen quotation

This LCD Touchscreen HAT fits snuggly on top of the Raspberry Pi, practically form fitting on top of it so as not to compromise the overall dimensions of the credit card sized single board computer. The resistive touchscreen provides you with an easy way to display information coming off of the Raspberry Pi and the OS currently running on it.

The 4:3 aspect ratio backlit LCD equipped on this HAT possesses a resolution of 480 by 320 pixels with over 65 thousand colors and an SPI interface with a 16MHz driver speed. Simply plug the 13x2 GPIO header into your desired Raspberry Pi and you"ll be able to start using your new resistive touch screen!

kedei 3.5 inch tft lcd display spi with touch screen quotation

I had in plans to create a custom driver but I decided this is not worth my time. I"m going to "re-interface" this lcd to be supported by fbtft. I have a prototype pcb with fbtft-spi interface ready (I have to send this project to pcb prototype service).

Unfortunatly, because of my "spider-circuit" I"ve broken my lcd (I"ve made a some short