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:

  1. Install debian –  the Chris boot kernel was not required – the module spidev is already included in the latest debian image
  2. Put this line into /etc/modules:  modprobe spidev bufsiz=256000
  3. Install wiringPi https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/
  4. Download and compile MI0283QT2-pi
  5. 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
  6. 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
  7. Unplug HDMI ( / DVI adapter)
  8. Move all USB devices to a powered hub
  9. Use a stroooong 5V usb power supply – a 1000 mAh smartphone plug was not enough
  10. Run these commands from a terminal connected via SSH as root:

[c]
gpio load spi
gpio -g mode 18 pwm
gpio -g pwm 18 1000
./fb
[/c]

start the x-server in a second console:

[c]
startx
[/c]

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

Building instructions

,

Leave a Reply

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