In my last post I attached the Watterott Display to my Raspi. The model MI0283QT-2 I have here is not available anymore and was replaced with the newer MI0283QT-9A display modul. Unfortunately, this new display uses a different graphics chip and thus the driver I wrote won’t work for these panels… 🙁
With my new display driver skills, I thought about adding this new module, too 🙂 A few days ago I received this new model and on the weekend I finally found a little time to investigate the new driver code… The new chip is an ILI9341 and uses a 9 bit SPI protocol to receive its commands… Phew, sounds a bit strange but notro’s fbtft driver framework again comes to the rescue: he has already supported the Adafruit22 which also uses 9 bit transfers and he also added an 9-bit SPI patch for the Raspi Linux kernel… With this starting point I was able to support the new display in a few hours:
Since the display supports the Linux framebuffer interface its also possible to run X11 with Xorg’s framebuffer driver on it:
Again I was able to drive the display with a 32 MHz SPI clock (even 48 MHz works) and got a stable and smooth 25 fps for the 320×240 pixels in 16 Bit RGB.
If you want to setup this display on your own Raspi then read on…
Setup the ILI9341 driver
I won’t repeat all the details of the last driver setup as a lot steps are very similar. Just read the previous driver setup page and then you’ll find the differences here:
- The hardware setup is unchanged! Its a HW compatible replacement module.
- The new driver is called ifi9341fb
- My GitHub repository holds the new driver source: cnvogelg/fbtft
- Clone the source. Reconfig and rebuild your kernel.
- Select the new ILI9341 driver either as a module or directly place it in the kernel
- Test run:
modprobe ili9341fb modprobe spidevices name=ili9341fb cs=1 fps=25
Use pre-compiled Kernel
If you don’t want to recompile your own kernel then you could use the binary drop I have uploaded on my site:
- Download raspi-linux-3.6.11-ili9341.tar.gz
- Unpack the archive
- The files in boot directory need to be copied in your Raspi’s /boot directory
- The files in root directory need to be places in your Raspi’s / (root) directory
- Make sure to backup your existing files in these directories first before overwriting them!
- Also ensure to keep the files in the same hierarchy as found in my archive.
- I use an 12.11 Ubuntu System (as vmware on my Mac) to mount my Raspi SD card and perform the changes there. This is the safer approach as I don’t replace the running directly on the Raspi…
- Insert your updated sd card and enjoy booting with your display’s console…
X11 on your Display
- Setting up the X11 desktop on your Raspbian system is fairly easy:
- Install the frame buffer driver (as root):
# apt-get install xserver-xorg-video-fbdev
- Create a config file with following contents in /usr/share/X11/xorg.conf.d/99-fbdev.conf:
Section "Device"Â Â Identifier "myfb" Driver "fbdev" Option "fbdev" "/dev/fb1" EndSection
- Now you can startx as a user and the desktop will be on your display:
> startx
That’s it for today… and enjoy your tiny desktop on the Raspi 🙂
BTW: notro was so kind to include my last driver in his mainline source tree… So you could grab the source also from his repository.
Really impressive work! Without looking at the code; how much CPU does this solution use? Do you know if there are any significant differences between ILI9341 and ILI9320 in SPI-mode? I was looking at buying a few of these: http://www.ebay.com/itm/2-8-inch-320×240-Touch-TFT-LCD-Display-Module-SPI-Interface-ILI9320-/181008290930?pt=LH_DefaultDomain_0&hash=item2a24ef5472
Jon, I haven’t measured CPU usage yet but it wasn’t observable in my tests. The load of the driver is mainly caused by syncing the framebuffer contents to the display via SPI transfers. You can limit the interval of updates by giving the ‘fps’ (frames per second) option in the drivers. Then at most the number of fps frames are sent per second to the display SPI. This gives you an upper bound of data transfer volume caused by the driver and lets you estimate the load..
Hi Lallafa,
First of all congrats for your hard work. As I am not too familiar with compiling the linux kernel I have download the file “raspi-linux-3.6.11-ili9341.tar.gz”. I double checked that all the connections are ok. But when I boot the system I can’t see anything on my display:)
I would appreciate if you could help me out with this.
Many thanks in advance.
Regards,
Hi lallafa,
thank you for the great work of the connection MI0283QT-9A on Rasbperry Pi. It helps me a lot. I use Raspbian “wheezy†http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip an put your raspi-linux-3.6.11-ili9341.tar.gz in it. It works but not complet. I am able to load ili9341fb but not spidevices name=ili9341fb cs=1 fps=25. Never the less the startx works and give an x-screen on the MI0283QT-9A.
Only the touch do not work. Do you have an idea?
Thank you.
Marc
Hi Lallafa,
Let me be more specific with my issue. My /boot directory is empty but I have noticed that both the kernel.img and the cmdline/txt are located in the small 56 MB partition on the SD Card. Is this the right location where I should copy the 2 files that I found in your /boot directory? Also the /lib directory is not inside the directory called /root but is in the main directory. Shall I copy your /lib folder there then?
I understand that they might sound stupid questions but the true is that I am not that familiar with it:)
Many thanks in advance.
Regards.
@marc: If you use my rasp-linux tar ball then the ili display driver is already built directly into the kernel. Therefore, you can’t load it afterwards with the spidevices module. Its simply not necessary. If you want to alter parameters of the module then you have to recompile the whole kernel in this case. Touch will not work as the touch driver is not compiled into the kernel in this tar ball 🙂 If you want to have touch then you have to recompile it… See my recent post on this topic.
@alrbertone74: The layout of the tar ball is as follows: the ‘boot’ directory contains the contents of the ‘boot’ partition (the first one with VFAT) and ‘root’ the contents for the second one (the root filesystem in ext format). On you Pi itself you’ll find the boot partition mounted on /boot and the root partition on /
Hi Lallafa,
Many thanks for getting back to me. I will have a look at it and I will let you know how it goes!
Hi lallafa,
i have found severals wirings for the MI0283QT-9A to RaspberryPi but nothing work 🙁
can someone or u send me an email to royblack333@gmail.com with a short manual ?
thanks guys …
Hi Lallafa,
Sorry to bother you again I think I am doing something wrong. I can’t figure it out what though. Basically after loading the driver the display becomes all white and nothing else happens. I would appreciate if you could help me out with this.
Many thanks in advance.
Regards.
Hi Philipp,
the essential tip is to set the speed to 48000000 (speed=48000000).
I wish you maximal success.
Marc
Hi lallafa,
now it works, i found the solution, i wired up the CE1 to CE0 on Raspberry, restarted the Pi and now it works.
Have a Nice day
Hi Lallafa,
Just to let you know that finally I managed to get the display to work thanks to Notro’s help! I am so happy about it. Now I want to add the touch support!
Pingback: Adafruit’s TFT + raspberrypi + camera | not relevant / permanent TODO
Pingback: Turning a Rapsberry Pi into a portable streaming camera | …