{"id":583,"date":"2013-03-03T17:56:52","date_gmt":"2013-03-03T15:56:52","guid":{"rendered":"http:\/\/lallafa.de\/blog\/?p=583"},"modified":"2013-06-01T21:18:04","modified_gmt":"2013-06-01T19:18:04","slug":"watterott-display-on-raspberry-pi","status":"publish","type":"post","link":"https:\/\/lallafa.de\/blog\/2013\/03\/watterott-display-on-raspberry-pi\/","title":{"rendered":"Watterott Display on Raspberry Pi"},"content":{"rendered":"<p>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.<\/p>\n<p>A very nice and cheap TFT display is the\u00c2\u00a0<a href=\"https:\/\/github.com\/watterott\/MI0283QT-Adapter\">MI0283QT-Adapter<\/a> (note: I got the -2 version not the newer -9 version that has another display driver chip!) sold by <a href=\"http:\/\/www.watterott.com\">Watterott<\/a>. Its mainly focused to be an add on for the Arduinos, but it should work on every embedded system providing SPI access.<\/p>\n<p>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, &#8230;).<\/p>\n<p>First I thought about writing a fresh driver from scratch but some google-fu showed me that there already exists a nice solution: user <strong>notro<\/strong> has written <a href=\"https:\/\/github.com\/notro\/fbtft\">fbtft<\/a>, a driver framework that allows to simplify writing an own driver for those tiny TFTs.<\/p>\n<p>For the <strong>R61505u<\/strong> display chip found on my display board, there was no driver available, but thanks to notro&#8217;s powerful framework and Watterott&#8217;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 <a href=\"https:\/\/github.com\/cnvogelg\/fbtft\/\">cloned fbtft Git Hub repository<\/a> for the source.<\/p>\n<p>It works really nice: with 32 MHz SPI clock I can run 25 frames per second and even watch movies with smooth display:<\/p>\n<div id=\"attachment_584\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-584\" data-attachment-id=\"584\" data-permalink=\"https:\/\/lallafa.de\/blog\/2013\/03\/watterott-display-on-raspberry-pi\/display1\/\" data-orig-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1.jpg?fit=640%2C427&amp;ssl=1\" data-orig-size=\"640,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;Canon EOS 650D&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1362305317&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;90&quot;,&quot;iso&quot;:&quot;1600&quot;,&quot;shutter_speed&quot;:&quot;0.008&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"display1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1.jpg?fit=300%2C200&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1.jpg?fit=584%2C390&amp;ssl=1\" class=\"size-medium wp-image-584\" title=\"display1\" src=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1-300x200.jpg?resize=300%2C200\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1.jpg?resize=300%2C200&amp;ssl=1 300w, https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1.jpg?resize=150%2C100&amp;ssl=1 150w, https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1.jpg?resize=400%2C266&amp;ssl=1 400w, https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display1.jpg?w=640&amp;ssl=1 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-584\" class=\"wp-caption-text\">Playing Big Bug Bunny with MPlayer&#39;s fbdev output<\/p><\/div>\n<p>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:<\/p>\n<div id=\"attachment_585\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-585\" data-attachment-id=\"585\" data-permalink=\"https:\/\/lallafa.de\/blog\/2013\/03\/watterott-display-on-raspberry-pi\/display2\/\" data-orig-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2.jpg?fit=640%2C427&amp;ssl=1\" data-orig-size=\"640,427\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;Canon EOS 650D&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1362305511&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;70&quot;,&quot;iso&quot;:&quot;1250&quot;,&quot;shutter_speed&quot;:&quot;0.01&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"display2\" data-image-description=\"&lt;p&gt;Linux Boot Console running on the display&lt;\/p&gt;\n\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2.jpg?fit=300%2C200&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2.jpg?fit=584%2C390&amp;ssl=1\" class=\"size-medium wp-image-585\" title=\"display2\" src=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2-300x200.jpg?resize=300%2C200\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2.jpg?resize=300%2C200&amp;ssl=1 300w, https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2.jpg?resize=150%2C100&amp;ssl=1 150w, https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2.jpg?resize=400%2C266&amp;ssl=1 400w, https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2013\/03\/display2.jpg?w=640&amp;ssl=1 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-585\" class=\"wp-caption-text\">Linux Boot Console running on display<\/p><\/div>\n<p>If you want to build this setup yourself then read on&#8230;<\/p>\n<h3><!--more-->Build this yourself<\/h3>\n<p>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 \ud83d\ude42<\/p>\n<h4>Hardware<\/h4>\n<ul>\n<li>I used <a href=\"http:\/\/www.adafruit.com\/products\/801\">Adafruit&#8217;s Raspberry Pi Proto Plate<\/a> as a prototyping board for setting up the required connections between the Raspi and the display<\/li>\n<li>Its a very simple setup: only wires required \ud83d\ude42<\/li>\n<li>The following connections are required:<\/li>\n<\/ul>\n<pre>Name       Raspi        Display Board\r\n+5V        2+4          3+4   \r\nGND        6            1+2\r\nCS_DISP    26 (CE1)     7 \r\nRST_DISP   16 (GPIO23)  6\r\nLED_DISP   18 (GPIO24)  5\r\nMOSI       19           8\r\nMISO       21           9\r\nSCLK\u00c2\u00a0      23           10<\/pre>\n<ul>\n<li>See <a href=\"http:\/\/elinux.org\/RPi_Low-level_peripherals\">elinux.org&#8217;s Page<\/a> for details on the Raspi pinout<\/li>\n<li>See <a href=\"https:\/\/github.com\/watterott\/MI0283QT-Adapter\/tree\/master\/pcb\">Watterott&#8217;s schematics<\/a> for details of the display board<\/li>\n<\/ul>\n<h4>Software<\/h4>\n<ul>\n<li>First have a look at <a href=\"https:\/\/github.com\/notro\/fbtft\/wiki\">notro&#8217;s wiki pages<\/a>: There you find details on how to clone the Linux kernel source and set up everything on your system.<\/li>\n<li>I prefer cross-compiling the kernel on a Ubuntu host system for speed reasons. Have a look at <a href=\"http:\/\/elinux.org\/RPi_Kernel_Compilation\">elinux.org&#8217;s Kernel Compilation Page<\/a> for details.<\/li>\n<li>Remember to replace notro&#8217;s GitHub source tree with mine:<\/li>\n<\/ul>\n<pre>git clone\u00c2\u00a0https:\/\/github.com\/cnvogelg\/fbtft.git<\/pre>\n<ul>\n<li>For a first test use the following commands:<\/li>\n<\/ul>\n<pre># modprobe spi-bcm2708\r\n# modprobe spidevices name=r61505ufb fps=25\r\n# modprobe r61505ufb<\/pre>\n<ul>\n<li>This will initialize the display and clear the garbled initial display to a black screen that is lit with the backlight. You&#8217;ll find the framebuffer device \/dev\/fb1 in your filesystem<\/li>\n<li>Install mplayer and get a movie file. I used <a href=\"http:\/\/www.bigbuckbunny.org\/index.php\/download\/\">Big Bug Bunny<\/a> and the 320&#215;180 IPhone version. As root you can try:<\/li>\n<\/ul>\n<pre>#\u00c2\u00a0mplayer -vo fbdev:\/dev\/fb1 BigBuckBunny_320x180.mp4<\/pre>\n<ul>\n<li>Enjoy the smooth playback!<\/li>\n<\/ul>\n<p>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:<\/p>\n<ul>\n<li>Again follow <a href=\"https:\/\/github.com\/notro\/fbtft\/wiki\/Build-kernel-and-fbtft-drivers\">notro&#8217;s guide<\/a><\/li>\n<li>For the platform specific setup I prepared a<a href=\"https:\/\/github.com\/cnvogelg\/fbtft\/blob\/master\/contrib\/bcm2708-r61505ufb.patch\"> r61505ufb patch<\/a> that you can apply to your source<\/li>\n<li>Build a fresh new kernel and if everything worked out ok then your Raspi will boot into your new console display&#8230;<\/li>\n<\/ul>\n<p>Have fun with your new tiny but shiny Raspi display!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/lallafa.de\/blog\/2013\/03\/watterott-display-on-raspberry-pi\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8,1,16],"tags":[],"class_list":["post-583","post","type-post","status-publish","format-standard","hentry","category-hardware","category-misc","category-raspberry-pi"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/piBMF-9p","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/comments?post=583"}],"version-history":[{"count":8,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":592,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions\/592"}],"wp:attachment":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/media?parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/categories?post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/tags?post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}