{"id":631,"date":"2013-06-11T00:56:07","date_gmt":"2013-06-11T07:56:07","guid":{"rendered":"https:\/\/www.uniteng.com\/?p=631"},"modified":"2021-01-05T14:45:46","modified_gmt":"2021-01-05T06:45:46","slug":"1-8-inch-tft-screen-for-raspberry-pi","status":"publish","type":"post","link":"https:\/\/www.uniteng.com\/index.php\/2013\/06\/11\/1-8-inch-tft-screen-for-raspberry-pi\/","title":{"rendered":"1.8 Inch TFT Screen for Raspberry Pi"},"content":{"rendered":"<p style=\"text-align: justify;\">\n\tThis is a short Application Note about how to use ST7735R Controller based TFT screen with <a href=\"http:\/\/projects.archive.uniteng.com\/digital-system-projects\/raspberrypiuniversalexpansionboard\" target=\"_blank\" rel=\"noopener\">RaspberryPi Universal Expansion Board <\/a>and RaspberryPi. More information about the screen can be found in the list of my&nbsp;<a href=\"https:\/\/www.uniteng.com\/index.php\/2013\/05\/08\/peripheral-boards\/\" target=\"_blank\" rel=\"noopener\">Peripheral Boards<\/a>.\n<\/p>\n<p>\n\t<strong>Part I: Hardware<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tConnect RaspberryPi,&nbsp;<a href=\"http:\/\/projects.archive.uniteng.com\/digital-system-projects\/raspberrypiuniversalexpansionboard\" target=\"_blank\" rel=\"noopener\">RaspberryPi Universal Expansion Board<\/a> and the <a href=\"https:\/\/www.uniteng.com\/neildocs\/datasheets\/ST7735R_V0.2.pdf\" target=\"_blank\" rel=\"noopener\">ST7735R<\/a> Controller based TFT screen as Figure 1.\n<\/p>\n<p style=\"text-align: center;\">\n\t<a href=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"RPI_UEB_TFT\" class=\"alignnone size-full wp-image-646\" height=\"360\" src=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT.png\" width=\"605\" srcset=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT.png 1181w, https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT-300x178.png 300w, https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT-1024x609.png 1024w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/a>Figure 1<br \/>\n\t&nbsp;\n<\/p>\n<p style=\"text-align: justify;\">\n\tThe SPI interface of RaspberryPi needs to be mapped to the screen by using following Verilog code.\n<\/p>\n<pre class=\"brush:cpp;\">\r\nmodule RS232(RXD_in,TXD_in,RXD_out,TXD_out,\r\nCS_in,CS_out,SDA_in,SDA_out, SCK_in, SCK_out, A0_in, A0_out, RESET_in, RESET_out, LED_in, LED_out);\r\n \r\ninput   RXD_in, TXD_in,CS_in,SDA_in,SCK_in,A0_in,RESET_in, LED_in;\r\noutput  RXD_out,TXD_out,CS_out, SDA_out,SCK_out, A0_out, RESET_out, LED_out;\r\n \r\nassign RXD_out = RXD_in;\r\nassign TXD_out = TXD_in;\r\n \r\n\/\/assign pins for ST7735R LCD Controller \r\nassign CS_out    = CS_in;\r\nassign SDA_out   = SDA_in;\r\nassign SCK_out   = SCK_in;\r\nassign A0_out    = A0_in;\r\nassign RESET_out = RESET_in;\r\nassign LED_out   = LED_in;\r\n \r\nendmodule<\/pre>\n<p style=\"text-align: justify;\">\n\tNavigate to Quartus -&gt; Assignments -&gt; Pin Planner. The IO need to be configured as following picture.\n<\/p>\n<p style=\"text-align: center;\">\n\t<a href=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_CPLD.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"RPI_UEB_TFT_CPLD\" class=\"alignnone size-full wp-image-653\" height=\"257\" src=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_CPLD.png\" width=\"851\" srcset=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_CPLD.png 851w, https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_CPLD-300x90.png 300w\" sizes=\"auto, (max-width: 851px) 100vw, 851px\" \/><\/a>\n<\/p>\n<p>\n\tWe can flash the design into the CPLD right now.\n<\/p>\n<p>\n\t<strong>Part II: Linux Kernel<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tFollow Mark&#39;s article <a href=\"http:\/\/marks-space.com\/2012\/11\/23\/raspberrypi-tft\/\" target=\"_blank\" rel=\"noopener\">Raspberry Pi and TFT Display<\/a> to cross-compile and install the kernel with the screen driver on the RaspberryPi.\n<\/p>\n<p>\n\t<strong>Part III: Testing<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tDuring the booting and shutdown processes you will see the kernel messages on the screen, the uname -a command will show you the message similar as the Figure 2.\n<\/p>\n<p style=\"text-align: center;\">\n\t<a href=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_Testing1.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"RPI_UEB_TFT_Testing1\" class=\"alignnone size-full wp-image-655\" height=\"369\" src=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_Testing1.png\" width=\"557\" srcset=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_Testing1.png 776w, https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_Testing1-300x199.png 300w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><\/a><br \/>\n\tFigure 2\n<\/p>\n<p>\n\tEntering\n<\/p>\n<pre class=\"brush:bash;\">\r\nFRAMEBUFFER=\/dev\/fb1 startx<\/pre>\n<p>\n\twill launch the x11 environment as the Figure 3:\n<\/p>\n<p style=\"text-align: center;\">\n\t<a href=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_Testing2.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"RPI_UEB_TFT_Testing2\" class=\"alignnone size-full wp-image-659\" height=\"403\" src=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_Testing2.png\" width=\"533\" srcset=\"https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_Testing2.png 760w, https:\/\/www.uniteng.com\/wp-content\/uploads\/2013\/06\/RPI_UEB_TFT_Testing2-300x226.png 300w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<strong>Part IV: References<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\t[1] Kamal Mostafa. Adafruit\/SainSmart 1.8&quot; TFT LCD display for Raspberry Pi. Retrieved from http:\/\/www.whence.com\/rpi\/\n<\/p>\n<p style=\"text-align: justify;\">\n\t[2] Mark. Raspberry Pi and TFT Display. Retrieved from http:\/\/marks-space.com\/2012\/11\/23\/raspberrypi-tft\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a short Application Note about how to use ST7735R Controller based TFT screen with RaspberryPi Universal Expansion Board and RaspberryPi. More information about the screen can be found in the list of my&nbsp;Peripheral Boards. Part I: Hardware Connect RaspberryPi,&nbsp;RaspberryPi Universal Expansion Board and the ST7735R Controller based TFT screen as Figure 1. Figure [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ngg_post_thumbnail":0,"footnotes":""},"categories":[5],"tags":[13,6],"class_list":["post-631","post","type-post","status-publish","format-standard","hentry","category-hardware-notes","tag-peripheral-boards","tag-raspberrypi"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"neilhao","author_link":"https:\/\/www.uniteng.com\/index.php\/author\/neilhao\/"},"uagb_comment_info":0,"uagb_excerpt":"This is a short Application Note about how to use ST7735R Controller based TFT screen with RaspberryPi Universal Expansion Board and RaspberryPi. More information about the screen can be found in the list of my&nbsp;Peripheral Boards. Part I: Hardware Connect RaspberryPi,&nbsp;RaspberryPi Universal Expansion Board and the ST7735R Controller based TFT screen as Figure 1. Figure&hellip;","_links":{"self":[{"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/posts\/631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/comments?post=631"}],"version-history":[{"count":0,"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/posts\/631\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/media?parent=631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/categories?post=631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.uniteng.com\/index.php\/wp-json\/wp\/v2\/tags?post=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}