Headless Tiny Head Pi - Part 1

I've been meaning to set up a pi with a mini TFT screen for some time ( I bought parts a long time ago for peanuts before realising they were incompatible with the mk1 pi's I had ) and I finally started to do something with the components now I have a Model 3B+.

The TFT

Years ago I bought with some spare Christmas money a variety of component parts for projects I was working on or planning to work on. Two items that never made it into production were a small LCD screen and a 2.2" SPI TFT screen designed to work with the Raspberry Pi.

At the time I had a couple of version 1 Pi model B's and sadly I discovered they were slightly incompatible with this model of panel so they sat in my bits box along with some other electronics.

Recently I was gifted a Version 3B+ by the wonderful wife to help sort out some items on the home network and I thought this an opportune time to get the components out and start to put something together that is practical, useful and aesthetically pleasing.

Hardware Wiring

The wiring is via a ribbon connector that connects to the TFT board and to the PI's GPIO pins thus:

SDO - MISO (21)
LED - GPIO 18 (12)
SCK - SCLK (23)
SDI/MOSI - MOSI (19)
DC/RS - GPIO 24 (18)
RESET - GPIO 25 (22)
CS - CE 0 (24)
GND - GND (39)
VCC - 3.3V (1)

Setting up the screen in software first requires you to set up the pi ports using raspi-config

You need to go into Advanced Options, SPI - ENABLE the interface. Exit and save this - then use rpi-update to ensure you have the latest settings installed.
Once this has downloaded and installed, reboot the Pi.

Firing up the screen

The first thing to do is check the screen fires up:

~$ sudo su
modprobe fbtft_device name=tm022hdh26 rotate=90

This should fire the screen power up to verify your pin configuration was correct. Next we want to set this up for use when the Pi boots so that we can use it as a terminal output ( If you want to use it for Xwindows output you can use FRAMEBUFFER=/dev/fb1 startx to test the Xwindows configuration ).

We need to create some configuration files so the Pi knows where to output information:

nano /etc/modules-load.d/fbtft.conf

spi-bcm2835
fbtft_device

nano /etc/modprobe.d/fbtft.conf

options fbtft_device name=tm022hdh26 rotate=90 speed=80000000 fps=60

You also need to modify /etc/rc.local to add the following line(s)* before the final exit 0 statement:

nano /etc/modprobe.d/fbtft.conf

con2fbmap 1 1 sudo FRAMEBUFFER=/dev/fb1 startx

* If you don't want to fire up Xwindows don't include the startx line.

Restarting the Pi should now yield the wonderous output for the computer booting again. Next step : Getting some nice output information for running tasks...

gingerHeadlessPi

Happy hacking!
gingerCoder()

Previous Item.. Cheeky Solr Grabber