I really like my Raspberry Pi, but what I am missing is a tiny display matching the size of the board that can be used as primary display, the boot console or some graphics later on.
A very nice and cheap TFT display is the MI0283QT-Adapter (note: I got the -2 version not the newer -9 version that has another display driver chip!) sold by Watterott. Its mainly focused to be an add on for the Arduinos, but it should work on every embedded system providing SPI access.
For the Linux running on the Raspberry Pi a framebuffer driver for the display would be the best solution, as it allows you to use it as a boot console and then you can run everything that runs on a framebuffer device (e.g. X11, SDL, mplayer, …).
First I thought about writing a fresh driver from scratch but some google-fu showed me that there already exists a nice solution: user notro has written fbtft, a driver framework that allows to simplify writing an own driver for those tiny TFTs.
For the R61505u display chip found on my display board, there was no driver available, but thanks to notro’s powerful framework and Watterott’s example code (Thanks to Markus for porting the code to the Raspi), I was able to derive a new driver for this chip in a few hours: See my cloned fbtft Git Hub repository for the source.
It works really nice: with 32 MHz SPI clock I can run 25 frames per second and even watch movies with smooth display:
If you compile the driver directly in your kernel (i.e. no modules) then you can use the display directly as the boot console of your board:
If you want to build this setup yourself then read on…
Build this yourself
The following notes should guide you through the task of setting up the display yourself. Its not a step by step manual but rather a collection of hints and tips. It is assumed you are familiar with low-level stuff like building and setting up a new kernel for the Raspi, so you have been warned
- I used Adafruit’s Raspberry Pi Proto Plate as a prototyping board for setting up the required connections between the Raspi and the display
- Its a very simple setup: only wires required
- The following connections are required:
Name Raspi Display Board +5V 2+4 3+4 GND 6 1+2 CS_DISP 26 (CE1) 7 RST_DISP 16 (GPIO23) 6 LED_DISP 18 (GPIO24) 5 MOSI 19 8 MISO 21 9 SCLK 23 10
- See elinux.org’s Page for details on the Raspi pinout
- See Watterott’s schematics for details of the display board
- First have a look at notro’s wiki pages: There you find details on how to clone the Linux kernel source and set up everything on your system.
- I prefer cross-compiling the kernel on a Ubuntu host system for speed reasons. Have a look at elinux.org’s Kernel Compilation Page for details.
- Remember to replace notro’s GitHub source tree with mine:
git clone https://github.com/cnvogelg/fbtft.git
- For a first test use the following commands:
# modprobe spi-bcm2708 # modprobe spidevices name=r61505ufb fps=25 # modprobe r61505ufb
- This will initialize the display and clear the garbled initial display to a black screen that is lit with the backlight. You’ll find the framebuffer device /dev/fb1 in your filesystem
- Install mplayer and get a movie file. I used Big Bug Bunny and the 320×180 IPhone version. As root you can try:
# mplayer -vo fbdev:/dev/fb1 BigBuckBunny_320x180.mp4
- Enjoy the smooth playback!
This setup works great if you want to use the display after boot up as a second screen. However for a first screen you have to compile all drivers into the kernel itself:
- Again follow notro’s guide
- For the platform specific setup I prepared a r61505ufb patch that you can apply to your source
- Build a fresh new kernel and if everything worked out ok then your Raspi will boot into your new console display…
Have fun with your new tiny but shiny Raspi display!