{"id":858,"date":"2014-06-28T22:43:15","date_gmt":"2014-06-28T22:43:15","guid":{"rendered":"http:\/\/retroramblings.net\/?p=858"},"modified":"2014-06-28T23:59:57","modified_gmt":"2014-06-28T23:59:57","slug":"writing-to-a-tft-screen-with-zpuflex","status":"publish","type":"post","link":"https:\/\/retroramblings.net\/?p=858","title":{"rendered":"Writing to a TFT screen with ZPUFlex"},"content":{"rendered":"<p>A few months ago I bought a cheap 2.2 inch TFT screen on EBay but never managed to find the time to get it working, so today I dusted it off, and hooked it up to a nice little Cyclone IV dev board I bought some months previously.<\/p>\n<p><a href=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2014\/06\/TFT.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-859\" alt=\"TFT\" src=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2014\/06\/TFT.jpg\" width=\"777\" height=\"500\" srcset=\"https:\/\/retroramblings.net\/wp-content\/uploads\/2014\/06\/TFT.jpg 777w, https:\/\/retroramblings.net\/wp-content\/uploads\/2014\/06\/TFT-300x193.jpg 300w, https:\/\/retroramblings.net\/wp-content\/uploads\/2014\/06\/TFT-466x300.jpg 466w\" sizes=\"auto, (max-width: 777px) 100vw, 777px\" \/><\/a><!--more--><\/p>\n<p>This board doesn&#8217;t have a VGA port, and the FPGA is only 6000 LEs but it&#8217;s cheap and does have a 40-pin GPIO header and onboard SDRAM, so it&#8217;s quite a good board for ZPU-based projects.<\/p>\n<p>Since this project is even more experimental than usual, and is likely to be restricted to the one board, I&#8217;ve started a new branch in the ZPUDemos repo, called <a href=\"https:\/\/github.com\/robinsonb5\/ZPUDemos\/tree\/TFT\">&#8220;TFT&#8221;<\/a>.<\/p>\n<p>The TFT screen has an ILI9341 driver chip which is controlled via something that looks a lot like SPI &#8211; there is however one extra control line &#8211; D_C which is used to inform the display whether the byte being transferred over SPI is a command or data byte.\u00a0 I found some driver code for this chip in a PSOC4 project, and adapted it for use with the ZPU.<\/p>\n<p>So far the demo project creates a 320&#215;240 pixel 16-bit framebuffer, and repeatedly copies its contents to the display, updating the framebuffer each time.\u00a0 This is extremely slow &#8211; so my next project will be to bring the framebuffer update under DMA control.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few months ago I bought a cheap 2.2 inch TFT screen on EBay but never managed to find the time to get it working, so today I dusted it off, and hooked it up to a nice little Cyclone &hellip; <a href=\"https:\/\/retroramblings.net\/?p=858\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[],"class_list":["post-858","post","type-post","status-publish","format-standard","hentry","category-fpga","category-hardware"],"_links":{"self":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=858"}],"version-history":[{"count":4,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/858\/revisions"}],"predecessor-version":[{"id":862,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/858\/revisions\/862"}],"wp:attachment":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}