post

TinyLCD 35 from Tinylcd NeoSec

I bought a tiny 3.5 ”  lcd touchscreen from NeoSec Solutions Pvt, Ltd, based in Mumbai, India. Not as a desktop replacement but for projects where a small touchscreen will be handy.
Not recommended. I learned there is a newer version with a working RTC, so this is now a not-supported old version.
No forum support, no information on IC’s used, limited documentation.
Just too high a price for this. Better look at an Adafruit solution in the same price range, but with excellent support and better community support also.

In the beginning it looked good. But is has severe problems, such as an older kernel. And the RTC is not working, the time is not updated either from internet via ntp either. Acceptable price (total price including delivery to the Netherlands was $56), nicely packaged, fast delivery from India, professional pcb, bright and crisp screen, working touchscreen, well packaged and configured and friendly support from NeoSec (on demand by email only, no forum, no downloads). Biggest worry I have is the operational (except for date and time!)  but older Raspbian image supplied. Lets hope tinylcd/NeoSec updates its images, or better  supplies an easy to apply patch kit to more recent Raspbian versions like jessie! My first attempts to upgrade failed, I have to try getting Raspbian jessie operational, see the bottom of this post.

What is in the kit I bought (other versions with less features and other dimensions are also available at tinylcd)

  • 3.5” TFT LCD Display, 320×480 Resolution
  • Additional GPIO connector extending from  TFT pcb to use pins not in use (see later)  for other purposes. Esy to break off if not needed.
  • Resistive touchscreen and touchscreen controller.
  • 5 capacitive buttons on small navigation keyboard.
  • PCF8563 CMOS real-time clock/calendar.
  • room for a CR2032 lithium battery provision to maintain correct time and date on power loss.
  • Powered directly from the Raspberry Pi, no additional power required.
  • Touch pen.
  • Ready to plug on the GPIO connector with a size identical to the Raspberry B.
  • Downloadable image of Raspbian for a 8 GB SD card (older version, but well configured for lcd)  ready to run but the time is stuck at 1970.

IMG_2451 The screen fits nicely on the GPIO connector, and has the same size as the Raspberry, plus a breadboard like extension for the GPIO connector. Not that many are free, but it is a handy feature. It is easy to remove this connector, just break it off. IMG_4447 The device also has a RTC (battery on the back), a welcome addition to a Pi! But it does not work, so the time is set to 1970. NTP is inactive.IMG_4448 Here the Raspberry Pi B+ (the 2 Model B is also supported as is the A+!) has booted from the Raspian image as supplied by Tinylcd. The first part of the boot process is visible on the HDMI screen, once the tft It has a special kernel (fbtft drivers, more later on this)  and drivers for touchscreen, for RTC and  a mouse driver for the navigation key included and configured IMG_4452 The navigation buttons, connected to a lot of GPIO pins, and supported by a mouse driver on the desktop. IMG_4453 The screen is bright and crisp, not bad at all! As you can see, it is small and some menu’s will not be visible when folded out. This is not a desktop replacement, and that is not what this small screen is about! IMG_4456 The package came into a nice small tin! The packaging was fine, bubblewrap around the parts, screen protector attached. Well done!

GPIO pins in use

GPIO pins are used for TFT LCD Display, Touch Screen (TS), RTC & Navigation Keys. Note that the navigation keys take away a lot of pins! The SPI is used for the screen and touch. The RTC is on the I2C bus.

RPi 3.5''                             TFT

pin1 3V3 ---------------------------- TFT 3V3 / TS 3V3

pin18 GPIO24 ------------------------ TFT RS

pin19 GPIO10/MOSI ------------------- TFT MOSI / TS DIN

pin24 GPIO8/CE0 --------------------- TFT CS

pin23 GPIO11/CLK -------------------- TFT SCLK / TS DCLK

pin22 GPIO25 ------------------------ TFT RST

pin12 GPIO18/PWM -------------------- TFT BL

pin6 GND ---------------------------- TFT GND

pin21 GPIO9/MISO -------------------- TS DOUT

pin29 GPIO5 ------------------------- TS PENIRQ

pin26 GPIO7/CE1 --------------------- TS CS

pin13 GPIO27 ------------------------ LEFT KEY

pin16 GPIO23 ------------------------ RIGHT KEY

pin11 GPIO17 ------------------------ UP KEY

pin15 GPIO22 ------------------------ DOWN KEY

pin 37 GPIO4 ------------------------ SELECT KEY

pin3 GPIO2/SDA ---------------------- RTC SDA

pin5 GPIO3/SCL ---------------------- RTC SCL

Raspbian

The Raspbian image supplied is well configured. But because it has a special kernel one must be careful not to update the kernel! The readme tells us a lot about the device, how to

  • make the fbtft drivers work
  • calibrate the touchscreen
  • demo python programs  with graphics
  • turn the backlight on or off
  • enable mouse driver for navigation keys
  • enable  RTC IC (1307/PCF8563) (which dows not work!)
  • show demo movies or pictures
  • configure modules enable/disable via DTS (devicetree) in the supplied tinylcd35-all-overlay.dts

DIY Raspbian kernel The supplied kernel is special because it adds  the  Linux Framebuffer drivers for small TFT LCD display modules, see this website. fbtft is the name of the frame buffer (the memory where the Raspberry Pi stores the screen info) driver that copies the buffer via SPI to the LCD screen. Much more details about this is available at the fbtft wiki Now if you want a more recent kernel things are less complicated because the fbtft drivers are now included in Raspbian via its Debian chain! There is a step by step guide how to add the lcd support to a newer version (still wheezy afaik) by Notro. Not easy, but its all there I hope. Lets hope tinylcd updates its images. ot better  supplies an easy to apply patch kit to more recent Raspbian versions like jessie! And I have to discover how to set the time in the RTC, it now fall back to 1970, no internet update also.

From https://www.raspberrypi.org/forums/viewtopic.php?t=100227&p=696446 by huffy2404

» Thu Feb 19, 2015 6:23 am Here is what I did to get mine to work on the Pi 2. This is all taken from the notro/fbtft github wiki located here: https://github.com/notro/fbtft/wiki

Get dtc compiler with overlay support:

wget -c https://raw.githubusercontent.com/RobertCNelson/tools/master/pkgs/dtc.sh chmod +x dtc.sh ./dtc.sh

Get the tinylcd35 overlay source:

wget -c https://raw.githubusercontent.com/notro/fbtft/master/dts/overlays/rpi/tinylcd35-overlay.dts

Note that I am using the NeoSec 3.5″ TFT Display + Touch Screen.

This version does not include the touch pad or any extra buttons.

I believe the tinylcd35 overlay source is set up for the version of the screen that includes the touch pad. In order to get the touch screen to work I had to modify the overlay source file as follows:

On line 88 change:

interrupts = <3 2>; /* high-to-low edge triggered */

to:

interrupts = <5 2>; /* high-to-low edge triggered */

and on line 90 change: pendown-gpio = <&gpio 3 0>;

to:

pendown-gpio = <&gpio 5 0>;

From what I understand this is just needs to reflect the GPIO pin that is connected to the screen’s PENIRQ. Compile the overlay and save it in

/boot/overlays/: sudo dtc -@ -I dts -O dtb -o /boot/overlays/tinylcd35-overlay.dtb tinylcd35-overlay.dts

Add the following to your /boot/config.txt file:

# added for tinylcd 3.5 inch

dtparam=spi=on dtoverlay=tinylcd35

Install a custom Xorg config:

sudo mkdir -p /etc/X11/xorg.conf.d/ sudo

wget https://gist.github.com/notro/63fc8f563b5f85010d30/raw/5e68d6c6df9471f973b3da5305e73a5017590a69/fbtft.conf -O /etc/X11/xorg.conf.d/fbtft.conf

Update the Pi firmware:

sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update sudo reboot

The screen should be black at this point.

You can test by running:

FRAMEBUFFER=/dev/fb1 startx or con2fbmap 1 1

You can find information regarding calibration here:

https://github.com/notro/fbtft/wiki/FBTFT-on-Raspian

I have only completed the tslib portion since that is all I intend to use, but there is info for X there as well. I have successfully tested this on a Raspberry Pi 2 running both wheezy and jessie.

Leave a Reply

Your email address will not be published. Required fields are marked *