RaspberryPi sized touchscreen MI0283QT


18 posts
by dronus » Tue Nov 20, 2012 12:41 am
Image

The MI0283QT is a little cheap TFT screen that almost fits the size of the Pi. It is sold with an adapter board meant for the Arduino by Watterot. However, using some wires it can be attached to the RaspberryPi as well. This was done by Dominique Gallot as can be seen here: http://www.gallot.be/?p=197. He wrote a proprietary gaphics library for it.

I now made a user-space framebuffer driver, and a raspian touchscreen driver fork to make it usable by Xorg.

The framebuffer driver is special as it does not reside in the kernel for reasons explained in its README: https://github.com/dronus/MI0283QT2-pi/blob/master/README.md
It can be obtained here: https://github.com/dronus/MI0283QT2-pi

The touchscreen driver is implemented by the existing ads7846 driver using some patches to match the adapter board wiring. A kernel fork with the driver enabled can be obtained here: https://github.com/dronus/linux/tree/ads7846_support
In addition to the connections made by D. Gallot, the lcd adpter's IRQ pin needs to be connected to the Pi's GPIO17 pin. Otherwise a touch could not trigger an interrupt and thus is not detected.
This is a full fork as the driver is configured at boot time and takes away one of usually available SPI devices. As the TFT uses the remaining one, no SPI ports are left for other applications.

After running the framebuffer driver by its start.sh script, the X server should show up, and if the patched kernel is used, clicks can be done by touching the screen, as it should be :-)
Posts: 6
Joined: Mon Nov 05, 2012 8:13 pm
by jbeige » Wed Jan 09, 2013 10:18 pm
Very cool! Has this turned out to be useful for anything, or just a cool project?

I was thinking it might be really neat to make something like this to attach to my Openelec XBMC system to monitor something (not sure what) or run a remote control app.. But since none of the XBMC distros (Openelec, Raspbmc, or Xbian) are running an X server, I'm guessing this wouldn't work?
Posts: 4
Joined: Thu Sep 20, 2012 7:45 pm
by dronus » Fri Jan 11, 2013 5:04 pm
It was made to be attached to a RepRap 3d printer as user interface. That is almost completed.

XMBC will not propably not use X, but it would most likely be able to use the framebuffer device for output. So it would just work as well. However, any animation or movie displayed would be updated far to slow on the display. So a stripped down UI would be useful that do not display media but always UI controls.
Posts: 6
Joined: Mon Nov 05, 2012 8:13 pm
by ZEDD » Tue Feb 19, 2013 9:40 pm
this is so close to wanna do, i have just had a new car,my old car had radio that a had usb port (plug & play),so being a bit creative thought i would build my own media player using a PI. a touch screen would be ideal. Has anyone any info or expo on this.
User avatar
Posts: 1
Joined: Wed Jan 02, 2013 10:29 pm
by amaasbier » Tue Mar 12, 2013 12:32 pm
Thanks for further improving this dronus! This driver is great and actually the reason why I wanted to use a RPi in my current project.

Still, I have a problem with getting the touch interrupts to work correctly. The cursor doesn't quite point to where I push with my stylus. Did you calibrate this in any way?

Also it seems that the framebuffer driver works for 320x200, but not correctly for 320x240. On this mode, only the updated parts seem to work and it is kind of glitchy sometimes. Everything below 200 pixels on the y-axis gets updated quite infrequently, even if I move the mouse pointer around these areas.
Did you get this to work yet?

If you still don't know how to get the fonts bigger, this css helped me. I set it to 24 though, since it seems to scale down somehow.

If you want the driver to work while switching terminals (Alt+F1-F8), you can also change the framebuffer resolution in the /boot/config.txt (frambuffer_width/framebuffer_height). This works fine for me, especially if compiling the mini4x6 font along and enabling it via cmdline.txt via "fbcon=font:MINI4x6".
Posts: 13
Joined: Sun Feb 17, 2013 2:38 pm
by dronus » Tue Mar 12, 2013 9:53 pm
amaasbier wrote:Still, I have a problem with getting the touch interrupts to work correctly. The cursor doesn't quite point to where I push with my stylus. Did you calibrate this in any way?

No, for my case that wasn't needed. The default margin values fit the display quite well, I only used fingertips however, so a stylus may expose much smaller offsets. Maybe 'xinput_calibrator' can be used to calbrate this on a higher level, if the screens differ in hardware.

amaasbier wrote:Also it seems that the framebuffer driver works for 320x200, but not correctly for 320x240. On this mode, only the updated parts seem to work and it is kind of glitchy sometimes.

Yes, I have this problem too now. Thank you very much for exposing it depends on the resolution. The first thing that comes into my mind is the non-standard buffer size for the SPI interface. Maybe raising the size would help out. On the other hand, I remember it working once with 320x240, maybe without touch screen. So this may be related to the SPI abitration, as only one SPI interface is shared between the LCD and the touch screen.

I'm into heavy work at the moment, so it may take some time until I investigate into that, sorry.
Posts: 6
Joined: Mon Nov 05, 2012 8:13 pm
by harlock74 » Thu Mar 21, 2013 1:37 pm
Hi there,

Today I have received the touchsreen MI0283QT-9A and I am very excited abou it.

I would appreciate if someone could help me out with this technical issue. I am not too sure how to connect the display adaptor to my my Raspberry PI with the wires.

Shall I follow the connections as shown in this website here:

http://lallafa.de/blog/2013/03/watterot ... pberry-pi/

and if so, would you please be so kind as to explain to me the meaning of the following connections:

Name Raspi Display Board
+5V 2+4 3+4
GND 6 1+2

Does that mean that for example I have to connect the pin 2 (Raspi) with the pin 3 (Display board) and pin 4 (Raspi) with the pin 4 (Display board) ? And in the second example the pin 6 (Raspi) with a 'combined' wire connected to the pin 1 and 2 (Display board)?

or shall I use the connections shown here:

http://www.gallot.be/?p=197

which they would appear to be quite different.

Many thanks in advance for your kind help!!! :mrgreen:
Posts: 72
Joined: Fri Jan 18, 2013 10:47 am
by dronus » Thu Mar 21, 2013 7:29 pm
I think the connections made by D. Gallot are correct.

In addition to the connections listed in the page, the lcd adpter's "IRQ" pin needs to be connected to the RaspberryPi's "GPIO17" pin. Otherwise a touch on the screen would not be detected.

Before you try to use my drivers which are a little elaborate, you may try to get the LCD working alone as described by D. Gallot.
Posts: 6
Joined: Mon Nov 05, 2012 8:13 pm
by harlock74 » Thu Mar 21, 2013 8:58 pm
Hi,
Many thanks for getting back to me. I will follow your advice and I will try first with D. Gallot instructions and then I will try with your drivers.

As I am not a LInux guru can you please explain to me the meaning of

"You need a kernel with a SPI library. I only tested on Chris boot kernel"

How can I compile this Kernel?

Thanks for being patient :oops:
Posts: 72
Joined: Fri Jan 18, 2013 10:47 am
by amaasbier » Sat Mar 23, 2013 1:42 am
I don't think D. Gallot's library would be of any help since the MI0283QT-2 and the MI0283QT-9A use a completely different protocol. Try using lallaffa's sources.
You will find help on getting a kernel cross compiled over here.
If you want other users with the same problem to profit from your findings you may want to start a new thread, because the displays are quite different despite their names.
Last edited by amaasbier on Fri May 24, 2013 7:49 am, edited 1 time in total.
Posts: 13
Joined: Sun Feb 17, 2013 2:38 pm
by harlock74 » Sat Mar 23, 2013 9:49 am
Hi there,
Thanks for your advice. I was struggling indeed with the D. Gallot's library. I will definitely open a new thread once I get everything up and running. To be honest with you I am not too sure about the right connections between the Raspberry and the display. I will try again as soon as my wife is off :mrgreen:
Posts: 72
Joined: Fri Jan 18, 2013 10:47 am
by amaasbier » Sat Mar 23, 2013 2:48 pm
If you want to familiarize yourself with the Pins have a look at the wiki. Watch out that the pin numbers aren't the same as the GPIO numbers. See the images at the link, this explains everything I hope.

EDIT:
I just read at lallafa's blog that he's using the -2, not the -9A version. I did not find any driver for this yet.
Seems like you're on your own.

EDIT2:
Seems like he made a driver for both displays!
I'll try it out.
Last edited by amaasbier on Fri May 24, 2013 7:51 am, edited 2 times in total.
Posts: 13
Joined: Sun Feb 17, 2013 2:38 pm
by harlock74 » Sat Mar 23, 2013 8:56 pm
Hi,
As you said I am trying to familiarise with it all before actually starting :D

Yeap that's the right link for the drivers for my display:

http://lallafa.de/blog/2013/03/watterot ... bperry-pi/

Have you got the same display as mine at all? :ugeek:
Posts: 72
Joined: Fri Jan 18, 2013 10:47 am
by amaasbier » Wed Apr 03, 2013 1:24 am
I have the MI...-2.

I'm currently using lallafas driver for notros framebuffer driver framework in combination with dronus' touch driver. Without touch support, a framerate of about 25fps can be achieved, otherwise it's about 10fps. The display works well, as long as I don't drag / hold the pen down too long, but if doing so the display gets garbled and sometimes the RPi even crashes.

I don't know why, but maybe dronus has an idea?
Maybe it's a good idea to change the driver to disallow holding down?
Posts: 13
Joined: Sun Feb 17, 2013 2:38 pm
by Julian » Wed Apr 10, 2013 11:47 am
I have the same problem. I want to use the touchscreen as the primary input so crashing is a no go. I have to go as low as 5fps @2mhz with the screen to get it somewhat stable. I don't need dragging I only have simple buttons. Any Idea how to disable dragging/constant mouse down? I never developed or modified a driver before. Maybe it would help already to reduce the SPI clock for the touchscreen and turn up the TS_POLL_PERIOD.
Posts: 15
Joined: Fri Jun 29, 2012 9:24 am
by nthomson » Mon May 20, 2013 8:26 am
Did any one find good settings for the -2? I have also just compiled a kernel with lalaafa's driver and the Dronus touchscsreen support but similarly the screen becomes garbled. I am about to play with touchscreen variables but thought if any one had found a solution to make it stable?
Posts: 2
Joined: Mon Aug 06, 2012 10:54 pm
by amaasbier » Mon May 20, 2013 11:23 am
I fooled a little bit with the settings, but didn't get it to work without garbling. But I'd be happy if you'd try around some. I don't know if it's the display driver settings that makes everything look weird and sometime crash the two drivers, but suppose that it rather is the touch driver.
Would be happy to hear, if you could somehow improve on the current situtation.
Posts: 13
Joined: Sun Feb 17, 2013 2:38 pm
by raspbee » Sat Nov 09, 2013 8:14 am
I wonder if all this can work with this very cheap LCD display:

http://www.pollin.de/shop/suchergebnis. ... mmend=true
Posts: 34
Joined: Tue Sep 25, 2012 1:25 pm