TFT LCD display with 320×240 resolution for RASPBERRY PI

RASPBERRY PI is credit card size computer, which price is only about 35Euro. This makes it accessible to a wide range of people.

Despite its low price it is equipped with Broadcom’s SoC BCM2835, it contains very powerful ARM1176JZFS CPU running at 700MHz, with floating point, Videocore 4 GPU capable of BluRay quality playback, using H.264 at 40MBits/s. Unfortunately it needs a TV or monitor to display information.

TFT LCD display with 320x240 resolution for RASPBERRY PI

The goal of this project is to show how to change this TV with TFT LCD display 320×240 resolution, which is enough for presenting of simple text and even video information.

Such displays are fairly common and cheap. Can be found at Ebay for about $20. Their only disadvantage is that it needs at least 21 I/O lines to be handled. 16 data bits, SC, RS, RD, WR, RESET

The project avoids this disadvantage, with using SPI bus instead paralel. This way you need only 3 I/O lines to communicate with the LCD.

There is a disadvantage when using serial communication – low frame rate. But this low frame rate is enough for displaying static or slow changing information.

In addition there is touch panel which can replace keyboard and mouse. We need 3 more I/O lines to drive it.

TFT LCD display with 320x240 resolution for RASPBERRY PI

The serial data are latched in the cascade connected shift registers CD4094 through SPI_MOSI on rising front of SPI_SCLK. The CD4040 counts to 32 when it is enabled by SPI_CS0. After 16th clock pulse its Q5 output goes high. It causes every changing of internal state of shift registers to affect its parallel outputs. After 32th clock pulse Q5 goes low. It “latches” the state of shift registers. In the same time entering the data to LCD is enabled by its CS input.

This way by sending 4 bytes to SPI bus you can transfer 16 data bits and other driving signals (CSDCRDWRBL_CNT) to LCD display. Using this circuit you can increase the speed of data transfer to the LCD because it isn’t necessary to select SPI bus for every byte sent which is very slow proces.

The next step is to write a driver for so described converter. Or download already compiled from here and just copy it to Raspberry’s SD card

If you choose the long way you can follow next instrictions:

1. Follow the instructions from here, but before compile the kernel you should apply this patch ssd1289-linux.3.6.11.diff to the sources by using “patch -p1 -i ssd1289-linux.3.6.11.diff” from directory ~/linux

2. Comment blacklist spi-bcm2708 in the file /etc/modprobe.d/raspi-blacklist.conf

3. Add into the file /etc/modules a line with content ssd1289

4. After reboot the module ssd1289 should be loaded. You can check this by “lsmod | grep ssd1289”

5. The easiest way to check if LCD is working is by redirecting console to new frame buffer “con2fbmap 1 1” or by staring X with “FRAMEBUFFER=/dev/fb1 startx”

6. If you want this redirecting to be permanent you can change content of the file /boot/cmdline.txt to: “dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:1 fbcon=font:ProFont6x11”

Source: TFT LCD display with 320×240 resolution for RASPBERRY PI

Scroll to Top
Read previous post:
List of required material using raspberry pi

Raspberry Pi 8GB SDHC Class 10 Card Nano Wifi-Stick Flytron Navigatron I2C GPS 4­channel I2C­safe Bi­directional Logic Level Converter ADS1015...

Close