Rasperry Pi SPI Touchscreen X-Server
Thanks to Dominique Gallot and vis, I managed to drive a MI0283QT-2 color touchscreen on the raspi 🙂
I followed the steps at www.gallot.be/?p=197 and added the framebuffer driver by vis to run X and LXDE-desktop. 40px in vertical are missing and touch is not working yet, but it’s very funny to use a mouse on the mini-screen.
Dominique Gallot’s howto is very accurate, so these are just additional notes to avoid a few catches I noticed:
- Install debian – the Chris boot kernel was not required – the module spidev is already included in the latest debian image
- Put this line into /etc/modules:
modprobe spidev bufsiz=256000
- Install wiringPi https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/
- Download and compile
MI0283QT2-pi
- Download the framebuffer driver by vis: https://snr.freifunk.net/trac/vis/browser/raspberrypi/fb.cpp into a subfolder on the same level as MI0283QT2/ and compile it with:
gcc -lstdc++ -iquote ../MI0283QT2 fb.cpp ../MI0283QT2/MI0283QT2.cpp ../MI0283QT2/font*.c -o fb
- Put https://snr.freifunk.net/trac/vis/browser/raspberrypi/10-monitors.conf into /usr/share/X11/xorg.conf.d to set X server resolution to 320×200 px
- Unplug HDMI ( / DVI adapter)
- Move all USB devices to a powered hub
- Use a stroooong 5V usb power supply – a 1000 mAh smartphone plug was not enough
- Run these commands from a terminal connected via SSH as root:
gpio load spi gpio -g mode 18 pwm gpio -g pwm 18 1000 ./fb
start the x-server in a second console:
startx
As you can see in the pictures, the startmenu of LXDE is not really readable and the terminal- fonts are too small, but I’m sure to find some nice applications for this setup.
The gameoflife demo runs very well: its fast and stable. It uses 30-34% CPU