{"id":393,"date":"2018-04-15T13:40:00","date_gmt":"2018-04-15T13:40:00","guid":{"rendered":"http:\/\/bitluni.net\/?page_id=393"},"modified":"2019-11-11T16:38:33","modified_gmt":"2019-11-11T16:38:33","slug":"esp32-color-pal","status":"publish","type":"post","link":"https:\/\/bitluni.net\/esp32-color-pal","title":{"rendered":"ESP32 Color PAL"},"content":{"rendered":"<p><iframe loading=\"lazy\" title=\"Color PAL Encoding\" width=\"1080\" height=\"608\" src=\"https:\/\/www.youtube.com\/embed\/-JXuwwXQh8c?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>This project shows how to generate a color PAL composite signal using the built in DACs of the ESP32.<br \/>\nYou might want to check out the complete playlist on the development of an ESP32 based game console.<br \/>\n<a href=\"https:\/\/www.youtube.com\/playlist?list=PLjUbKCHhzPEzCm2_KFAICIN-7QTap_s72\">https:\/\/www.youtube.com\/playlist?list=PLjUbKCHhzPEzCm2_KFAICIN-7QTap_s72<\/a><\/p>\n<h2>Color encoding demo<\/h2>\n<p>(Full size version <a href=\"https:\/\/bitluni.net\/wp-content\/uploads\/2018\/04\/YUVDemo.html\">here<\/a>)<br \/>\n<iframe loading=\"lazy\" src=\"https:\/\/bitluni.net\/wp-content\/uploads\/2018\/04\/YUVDemoSmall.html\" width=\"1600\" height=\"900\" frameborder=\"0\" data-mce-fragment=\"1\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"zoom: 100%; display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span>&lt;span data-mce-type=&#8221;bookmark&#8221; style=&#8221;display: inline-block; width: 0px; overflow: hidden; line-height: 0;&#8221; class=&#8221;mce_SELRES_start&#8221;&gt;\ufeff&lt;\/span&gt;&lt;span data-mce-type=&#8221;bookmark&#8221; style=&#8221;display: inline-block; width: 0px; overflow: hidden; line-height: 0;&#8221; class=&#8221;mce_SELRES_start&#8221;&gt;\ufeff&lt;\/span&gt;<\/iframe><\/p>\n<h2>Parts<\/h2>\n<p>The part used here is a LOLIN32 board.&nbsp;But Any ESP32 board can be used.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-159\" src=\"https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-front-300x209.jpg\" alt=\"\" width=\"396\" height=\"276\" srcset=\"https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-front-300x209.jpg 300w, https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-front-600x418.jpg 600w, https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-front-768x535.jpg 768w, https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-front-400x280.jpg 400w, https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-front.jpg 1006w\" sizes=\"(max-width: 396px) 100vw, 396px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-158\" src=\"https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-back-300x262.jpg\" alt=\"\" width=\"317\" height=\"277\" srcset=\"https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-back-300x262.jpg 300w, https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-back-600x524.jpg 600w, https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-back-768x671.jpg 768w, https:\/\/bitluni.net\/wp-content\/uploads\/2017\/11\/lolin32-back.jpg 806w\" sizes=\"(max-width: 317px) 100vw, 317px\" \/><\/p>\n<p>These links are the cheapest I could find and also supporting our work (affiliate). I also ordered my modules there<br \/>\n<a href=\"http:\/\/s.click.aliexpress.com\/e\/jYvJIEi\">LOLIN32 Board (~$6.90)<\/a><\/p>\n<p>But there are also cheap modules on Amazon and eBay:<br \/>\n<a href=\"http:\/\/amzn.to\/2Gk0hIH\">Amazon.com<\/a>&nbsp;&nbsp;<a href=\"http:\/\/amzn.to\/2BtUoF8\">.ca<\/a>&nbsp;&nbsp;<a href=\"http:\/\/amzn.to\/2DCcDdk\">.de<\/a>&nbsp;&nbsp;<a href=\"http:\/\/amzn.to\/2ndQLxG\">.fr<\/a><br \/>\n<a href=\"http:\/\/rover.ebay.com\/rover\/1\/711-53200-19255-0\/1?icep_ff3=9&amp;pub=5575230344&amp;toolid=10001&amp;campid=5337966422&amp;customid=&amp;icep_uq=esp32&amp;icep_sellerId=&amp;icep_ex_kw=&amp;icep_sortBy=12&amp;icep_catId=&amp;icep_minPrice=&amp;icep_maxPrice=&amp;ipn=psmain&amp;icep_vectorid=229466&amp;kwid=902099&amp;mtid=824&amp;kw=lg\">Ebay&nbsp;<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-264\" src=\"https:\/\/bitluni.net\/wp-content\/uploads\/2018\/01\/EN.png\" alt=\"\" width=\"32\" height=\"16\"><\/a>&nbsp;&nbsp;<a href=\"http:\/\/rover.ebay.com\/rover\/1\/707-53477-19255-0\/1?icep_ff3=9&amp;pub=5575230344&amp;toolid=10001&amp;campid=5337966422&amp;customid=&amp;icep_uq=esp32&amp;icep_sellerId=&amp;icep_ex_kw=&amp;icep_sortBy=12&amp;icep_catId=&amp;icep_minPrice=&amp;icep_maxPrice=&amp;ipn=psmain&amp;icep_vectorid=229487&amp;kwid=902099&amp;mtid=824&amp;kw=lg\">.de<\/a>&nbsp;&nbsp;<a href=\"http:\/\/rover.ebay.com\/rover\/1\/709-53476-19255-0\/1?icep_ff3=9&amp;pub=5575230344&amp;toolid=10001&amp;campid=5337966422&amp;customid=&amp;icep_uq=esp32&amp;icep_sellerId=&amp;icep_ex_kw=&amp;icep_sortBy=12&amp;icep_catId=&amp;icep_minPrice=&amp;icep_maxPrice=&amp;ipn=psmain&amp;icep_vectorid=229480&amp;kwid=902099&amp;mtid=824&amp;kw=lg\">.fr<\/a><\/p>\n<h2>Wiring<\/h2>\n<p>The wiring is quite simple. The video is connected to gpio 25 and the audio to 26. A capacitor of 10\u00b5F should be used to remove the DC offset.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-387\" src=\"https:\/\/bitluni.net\/wp-content\/uploads\/2018\/03\/wireing-4-1524x857.png\" alt=\"\" width=\"640\" height=\"360\" srcset=\"https:\/\/bitluni.net\/wp-content\/uploads\/2018\/03\/wireing-4-1524x857.png 1524w, https:\/\/bitluni.net\/wp-content\/uploads\/2018\/03\/wireing-4-600x338.png 600w, https:\/\/bitluni.net\/wp-content\/uploads\/2018\/03\/wireing-4-768x432.png 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<h2>Code<\/h2>\n<p>The code is written in C++ and runs in the Arduino IDE. The Arduino ESP32 integration is needed to compile the code (Please follow the instructions here:&nbsp;<a href=\"https:\/\/github.com\/espressif\/arduino-esp32\">https:\/\/github.com\/espressif\/arduino-esp32<\/a>).<\/p>\n<p>You can find the blue planet demo from the video in the github repository <a href=\"https:\/\/github.com\/bitluni\/DawnOfAV\">DawnOfAV<\/a>.<br \/>\nCheck out the project page on the last part for more details&nbsp;<a href=\"https:\/\/bitluni.net\/esp32-composite-audio\/\">https:\/\/bitluni.net\/esp32-composite-audio\/<\/a><\/p>\n<p>The code for the new editor can be found here<a href=\"https:\/\/github.com\/bitluni\/WavetableEditor\"><br \/>\n<\/a><a href=\"https:\/\/github.com\/bitluni\/SpriteEditor\">https:\/\/github.com\/bitluni\/SpriteEditorRGBA<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>RGBA Sprite Editor<\/h2>\n<p>The sprite editor has the possibility to store and restore complex projects as a .json file. This way you can modify your sprite collections later. Exported .h can&#8217;t be loaded again since the original graphic files are lost in the process. When storing .json and .h a link is shown which has to be clicked to store the file. When exporting .h also a .txt file is provided with the indices and file names for your reference.<br \/>\nUse the mouse to add points to a sprite. The first point is used as origin of the sprite (if not set the upper left corner is used).. further points can be used arbitrarily.<br \/>\nThe format of the resulting header is 16 bit per pixel RGBA with 4 bits for each component.<\/p>\n<p>?&nbsp;: open project stored as .json file<br \/>\n?&nbsp;: store project as .json file<br \/>\n?&nbsp;: add graphic files<br \/>\n.h : export as header file<br \/>\nname : This is the name the files and the sprites in the code will have (just use characters valid for variable names)<br \/>\n? : zoom in the sprites to set points easier<br \/>\n\u2317 : cropping. all sprites will be reduced to the non-transparent portion. points will be adapted. Use carefully.. there is no undo. I use it after saving to .json and before export to .h so safe some space.<\/p>\n<p>(if you need more space use <a href=\"https:\/\/bitluni.net\/wp-content\/uploads\/2018\/04\/SpriteEditorRGBA.html\">this link<\/a>)<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/bitluni.net\/wp-content\/uploads\/2018\/04\/SpriteEditorRGBA.html\" width=\"800\" height=\"400\" frameborder=\"0\" data-mce-fragment=\"1\">&lt;span data-mce-type=&#8221;bookmark&#8221; style=&#8221;display: inline-block; width: 0px; overflow: hidden; line-height: 0;&#8221; class=&#8221;mce_SELRES_start&#8221;&gt;\ufeff&lt;\/span&gt;&lt;span data-mce-type=&#8221;bookmark&#8221; style=&#8221;display: inline-block; width: 0px; overflow: hidden; line-height: 0;&#8221; class=&#8221;mce_SELRES_start&#8221;&gt;\ufeff&lt;\/span&gt;<\/iframe><\/p>\n<h2>Docs<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.radios-tv.co.uk\/Pembers\/World-TV-Standards\/Colour-Standards.html#PAL\"><strong>Web page on video signal encoding<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/esp-idf.readthedocs.io\/en\/v2.0\/api\/peripherals\/dac.html\">DAC API for the ESP32<\/a><\/li>\n<li><a href=\"http:\/\/espressif.com\/sites\/default\/files\/documentation\/esp32_technical_reference_manual_en.pdf\">ESP32 Technical Reference Manual<\/a><\/li>\n<\/ul>\n<h2>Similar Projects<\/h2>\n<p>Send me a message if you know of any similar projects<\/p>\n<p><a href=\"https:\/\/bitluni.net\/esp32-composite-audio\/\">https:\/\/bitluni.net\/esp32-composite-audio\/<\/a><br \/>\n<a href=\"https:\/\/bitluni.net\/esp32-composite-video\/\">https:\/\/bitluni.net\/esp32-composite-video\/<\/a><br \/>\n<a href=\"https:\/\/bitluni.net\/am-radio-transmitter\/\">My AM Radio transmitter. Also uses the DAC and I2S<\/a><br \/>\n<a href=\"https:\/\/bitluni.net\/oscilloscope-as-display\/\">My Oscilloscope as a Display Project. This uses the DAC. But I2S is used as camera input.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This project shows how to generate a color PAL composite signal using the built in DACs of the ESP32. You might want to check out the complete playlist on the development of an ESP32 based game console. https:\/\/www.youtube.com\/playlist?list=PLjUbKCHhzPEzCm2_KFAICIN-7QTap_s72 Color encoding demo (Full size version here) \ufeff\ufeff\ufeff\ufeff\ufeff\ufeff\ufeff\ufeff\ufeff\ufeff\ufeff\ufeff&lt;span data-mce-type=&#8221;bookmark&#8221; style=&#8221;display: inline-block; width: 0px; overflow: hidden; line-height: 0;&#8221; &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/posts\/393"}],"collection":[{"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/comments?post=393"}],"version-history":[{"count":4,"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/posts\/393\/revisions"}],"predecessor-version":[{"id":588,"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/posts\/393\/revisions\/588"}],"wp:attachment":[{"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/media?parent=393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/categories?post=393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitluni.net\/wp-json\/wp\/v2\/tags?post=393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}