{"id":1638,"date":"2015-10-02T00:36:43","date_gmt":"2015-10-01T23:36:43","guid":{"rendered":"http:\/\/www.analysir.com\/blog\/?p=1638"},"modified":"2016-07-05T19:36:06","modified_gmt":"2016-07-05T18:36:06","slug":"backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart","status":"publish","type":"post","link":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/","title":{"rendered":"Backdoor uPWM Hack on Photon for Infrared signals using UART"},"content":{"rendered":"<p>Since we received our Photon several months ago it has been difficult to find a working example of Hardware PWM on the Photon. Initially, we ported our softPWM approach to the Photon, which is excellent. However, we figured it must be possible to use at least one of the spare UARTs on the Photon to achieve our goal. So first we started prototyping on the Arduino and quickly got a working example with some limitations &#8211; only 40 kHz and 33 kHz carrier frequencies were possible with the UART without delving into the registers a bit more. Then we moved the code over to the Photon, leveraging our <strong><a href=\"http:\/\/www.analysir.com\/blog\/2015\/09\/01\/simple-infrared-pwm-on-arduino-part-3-hex-ir-signals\/\" target=\"_blank\">previous softPWM examples<\/a><\/strong>, upgraded with the Arduino code &#8211; EUREKA! The Backdoor uPWM Hack on Photon for Infrared signals.<\/p>\n<figure id=\"attachment_1641\" aria-describedby=\"caption-attachment-1641\" style=\"width: 913px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png\" target=\"_blank\" rel=\"attachment wp-att-1641\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1641 size-full\" src=\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png\" alt=\"uPWM Circuit diagram for Photon\" width=\"913\" height=\"597\" srcset=\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png 913w, https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit-300x196.png 300w\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" \/><\/a><figcaption id=\"caption-attachment-1641\" class=\"wp-caption-text\">uPWM Circuit diagram for Photon using UART<\/figcaption><\/figure>\n<p><!--more--><\/p>\n<p><strong>The Hack<\/strong><br \/>\nQuite simple really &#8211; just set the baud rate to 10 times the desired Infrared carrier frequency and send a &#8216;magic&#8217; 8 bit character to achieve the correct duty cycle. Of course we need to take the 1-start bit and 1-stop bit into account plus the 8 bits in each character. Remember that the UART sends the data inverted, so this needs to be taken into account with the\u00a0 characters sent and also in the IR LED driver circuit above, which required 2 transistors instead of the usual one. In summary, sending the following characters will generate the associated duty cycle, as follows:<\/p>\n<ul>\n<li>0xF0 &#8211; 50%<\/li>\n<li>0xF8 &#8211; 40%<\/li>\n<li>0xFC &#8211; 30%<\/li>\n<li>0xFE &#8211; 20%<\/li>\n<li>0xFF &#8211; 10%<\/li>\n<\/ul>\n<p>This is more than sufficient for most IR systems, which would typically use 50% or 33%. We defaulted the value in the sketch to 40% without problems. It should of course be possible to generate a duty cycle up to 90% by extending the code, which may be of interest in non-infrared applications.<\/p>\n<figure id=\"attachment_1642\" aria-describedby=\"caption-attachment-1642\" style=\"width: 604px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/Photon_uPWM_AnalysIR_Screenshot.jpg\" target=\"_blank\" rel=\"attachment wp-att-1642\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1642 size-large\" src=\"http:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/Photon_uPWM_AnalysIR_Screenshot-1024x473.jpg\" alt=\"Screenshot of signals received by AnalysIR from Photon using uPWM\" width=\"604\" height=\"279\" srcset=\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/Photon_uPWM_AnalysIR_Screenshot-1024x473.jpg 1024w, https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/Photon_uPWM_AnalysIR_Screenshot-300x139.jpg 300w, https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/Photon_uPWM_AnalysIR_Screenshot.jpg 1378w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><figcaption id=\"caption-attachment-1642\" class=\"wp-caption-text\">Screenshot of signals received by AnalysIR from Photon using uPWM &amp; UART<\/figcaption><\/figure>\n<p><strong>The Code<\/strong><br \/>\nI will leave it up to the reader to review the code and figure the rest out. Suffice to say we took the <strong><a href=\"http:\/\/www.analysir.com\/blog\/2015\/09\/01\/simple-infrared-pwm-on-arduino-part-3-hex-ir-signals\/\" target=\"_blank\">softPWM code in part 3 of the series<\/a><\/strong> and updated the PWM initialisation, mark &amp; space routines. Using this approach it should be relatively simple to finally\u00a0 port libraries like IRremote &amp; IRlib to Photon and get some awesome IR projects going at last! If you need any advice contact us via the website above.<\/p>\n<p>One of the real benefits of this approach is that there is no interference with any of the Photon&#8217;s &#8220;<strong><em>Cloud foo<\/em><\/strong>&#8221; or RTOS &#8211; which I suspect is the reason there has been no usable PWM for IR to date. Of course this approach should work with any MCU with a fast clock. Unfortunately, the 16MHz of the Arduino just isnt fast enough to get anything other that 40 or 33 kHz. We may look into playing with with the UART&#8217;s registers to achieve better performance on AVRs, using this approach, down the road.<\/p>\n<p>To test the uPWM, we wired up the Photon to the circuit above and used our soon to released LearnIR connected to AnalysIR to record the signals. As you can see from the screenshot of AnalysIR all test signals were received, decoded and at the correct carrier frequencies of 30, 33, 36,38,40 &amp; 56 kHz.<\/p>\n<p><strong>The Circuit<\/strong><br \/>\nThe circuit diagram above takes the inverted IR signal from the UART&#8217;s TX pin on the Photon and inverts it back to normal with the first transistor stage. The second transistor stage drives the IR signal at 150 mA using a 22R resistor. You can get 100mA using a 33R resistor and so on. There is also a superior<strong> <a href=\"http:\/\/www.analysir.com\/blog\/2013\/11\/22\/constant-current-infrared-led-circuit\/\" target=\"_blank\">constant current circuit<\/a> <\/strong>available on our blog, but you will have to design in the invert stage.<\/p>\n<p>You can <strong><a href=\"http:\/\/www.analysir.com\/blog\/?attachment_id=1645\" target=\"_blank\">download a copy of the Firmware<\/a><\/strong> for the Photon below.<\/p>\n<p>&nbsp;<\/p>\n<p><strong><a href=\"http:\/\/www.analysir.com\/blog\/get-analysir\/\" target=\"_blank\">Get your own copy of AnalysIR here<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since we received our Photon several months ago it has been difficult to find a working example of Hardware PWM on the Photon. Initially, we ported our softPWM approach to the Photon, which is excellent. However, we figured it must be possible to use at least one of the spare UARTs on the Photon to &hellip; <a href=\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Backdoor uPWM Hack on Photon for Infrared signals using UART<\/span> <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":{"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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1,10,61],"tags":[4,272,314,7,33,171,97,6,5,85,278,273,9,315,343],"class_list":["post-1638","post","type-post","status-publish","format-standard","hentry","category-analysir-blog","category-arduino","category-ir-sources","tag-analysir","tag-carrier-frequency","tag-duty-cycle","tag-infrared","tag-ir","tag-ir-led","tag-ir-signals","tag-irlib","tag-irremote","tag-nec","tag-photon","tag-pwm","tag-remote-control","tag-uart","tag-upwm"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Backdoor uPWM Hack on Photon for Infrared signals<\/title>\n<meta name=\"description\" content=\"Backdoor uPWM Hack on Photon for Infrared signals\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Backdoor uPWM Hack on Photon for Infrared signals\" \/>\n<meta property=\"og:description\" content=\"Backdoor uPWM Hack on Photon for Infrared signals\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/\" \/>\n<meta property=\"og:site_name\" content=\"AnalysIR Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/chris.analysir\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/chris.analysir\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-01T23:36:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-07-05T18:36:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png\" \/>\n<meta name=\"author\" content=\"User Two\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AnalysIR\" \/>\n<meta name=\"twitter:site\" content=\"@analysir\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"User Two\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/\"},\"author\":{\"name\":\"User Two\",\"@id\":\"https:\/\/www.analysir.com\/blog\/#\/schema\/person\/16a6d94c57d4f2629096ab80a7b36e13\"},\"headline\":\"Backdoor uPWM Hack on Photon for Infrared signals using UART\",\"datePublished\":\"2015-10-01T23:36:43+00:00\",\"dateModified\":\"2016-07-05T18:36:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/\"},\"wordCount\":650,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png\",\"keywords\":[\"AnalysIR\",\"Carrier frequency\",\"Duty Cycle\",\"Infrared\",\"IR\",\"IR LED\",\"IR signals\",\"IRLib\",\"IRremote\",\"NEC\",\"Photon\",\"pwm\",\"Remote control\",\"UART\",\"uPWM\"],\"articleSection\":[\"AnalysIR Blog\",\"Arduino\",\"IR Sources\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/\",\"url\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/\",\"name\":\"Backdoor uPWM Hack on Photon for Infrared signals\",\"isPartOf\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png\",\"datePublished\":\"2015-10-01T23:36:43+00:00\",\"dateModified\":\"2016-07-05T18:36:06+00:00\",\"description\":\"Backdoor uPWM Hack on Photon for Infrared signals\",\"breadcrumb\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#primaryimage\",\"url\":\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png\",\"contentUrl\":\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png\",\"width\":913,\"height\":597,\"caption\":\"uPWM Circuit diagram for Photon\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.analysir.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backdoor uPWM Hack on Photon for Infrared signals using UART\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.analysir.com\/blog\/#website\",\"url\":\"https:\/\/www.analysir.com\/blog\/\",\"name\":\"AnalysIR Blog\",\"description\":\"All about infrared remote control, IR decoding and more\",\"publisher\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.analysir.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.analysir.com\/blog\/#organization\",\"name\":\"AnalysIR\",\"url\":\"https:\/\/www.analysir.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.analysir.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/AnalysIR_and_IRToy.png\",\"contentUrl\":\"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/AnalysIR_and_IRToy.png\",\"width\":200,\"height\":200,\"caption\":\"AnalysIR\"},\"image\":{\"@id\":\"https:\/\/www.analysir.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/chris.analysir\",\"https:\/\/x.com\/analysir\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.analysir.com\/blog\/#\/schema\/person\/16a6d94c57d4f2629096ab80a7b36e13\",\"name\":\"User Two\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/8167f41ca01c8bf0646f87048aaf9e8f90e7d0b65650c0f8eaaf8002b288d6cb?s=96&d=identicon&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8167f41ca01c8bf0646f87048aaf9e8f90e7d0b65650c0f8eaaf8002b288d6cb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8167f41ca01c8bf0646f87048aaf9e8f90e7d0b65650c0f8eaaf8002b288d6cb?s=96&d=identicon&r=g\",\"caption\":\"User Two\"},\"sameAs\":[\"http:\/\/www.AnalysIR.com\",\"https:\/\/www.facebook.com\/chris.analysir\",\"https:\/\/x.com\/AnalysIR\"],\"url\":\"https:\/\/www.analysir.com\/blog\/author\/analysir\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Backdoor uPWM Hack on Photon for Infrared signals","description":"Backdoor uPWM Hack on Photon for Infrared signals","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/","og_locale":"en_US","og_type":"article","og_title":"Backdoor uPWM Hack on Photon for Infrared signals","og_description":"Backdoor uPWM Hack on Photon for Infrared signals","og_url":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/","og_site_name":"AnalysIR Blog","article_publisher":"https:\/\/www.facebook.com\/chris.analysir","article_author":"https:\/\/www.facebook.com\/chris.analysir","article_published_time":"2015-10-01T23:36:43+00:00","article_modified_time":"2016-07-05T18:36:06+00:00","og_image":[{"url":"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png","type":"","width":"","height":""}],"author":"User Two","twitter_card":"summary_large_image","twitter_creator":"@AnalysIR","twitter_site":"@analysir","twitter_misc":{"Written by":"User Two","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#article","isPartOf":{"@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/"},"author":{"name":"User Two","@id":"https:\/\/www.analysir.com\/blog\/#\/schema\/person\/16a6d94c57d4f2629096ab80a7b36e13"},"headline":"Backdoor uPWM Hack on Photon for Infrared signals using UART","datePublished":"2015-10-01T23:36:43+00:00","dateModified":"2016-07-05T18:36:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/"},"wordCount":650,"commentCount":0,"publisher":{"@id":"https:\/\/www.analysir.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png","keywords":["AnalysIR","Carrier frequency","Duty Cycle","Infrared","IR","IR LED","IR signals","IRLib","IRremote","NEC","Photon","pwm","Remote control","UART","uPWM"],"articleSection":["AnalysIR Blog","Arduino","IR Sources"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/","url":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/","name":"Backdoor uPWM Hack on Photon for Infrared signals","isPartOf":{"@id":"https:\/\/www.analysir.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#primaryimage"},"image":{"@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png","datePublished":"2015-10-01T23:36:43+00:00","dateModified":"2016-07-05T18:36:06+00:00","description":"Backdoor uPWM Hack on Photon for Infrared signals","breadcrumb":{"@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#primaryimage","url":"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png","contentUrl":"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/uPWM-Photon-Circuit.png","width":913,"height":597,"caption":"uPWM Circuit diagram for Photon"},{"@type":"BreadcrumbList","@id":"https:\/\/www.analysir.com\/blog\/2015\/10\/02\/backdoor-upwm-hack-on-photon-for-infrared-signals-using-uart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.analysir.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Backdoor uPWM Hack on Photon for Infrared signals using UART"}]},{"@type":"WebSite","@id":"https:\/\/www.analysir.com\/blog\/#website","url":"https:\/\/www.analysir.com\/blog\/","name":"AnalysIR Blog","description":"All about infrared remote control, IR decoding and more","publisher":{"@id":"https:\/\/www.analysir.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.analysir.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.analysir.com\/blog\/#organization","name":"AnalysIR","url":"https:\/\/www.analysir.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.analysir.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/AnalysIR_and_IRToy.png","contentUrl":"https:\/\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/AnalysIR_and_IRToy.png","width":200,"height":200,"caption":"AnalysIR"},"image":{"@id":"https:\/\/www.analysir.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/chris.analysir","https:\/\/x.com\/analysir"]},{"@type":"Person","@id":"https:\/\/www.analysir.com\/blog\/#\/schema\/person\/16a6d94c57d4f2629096ab80a7b36e13","name":"User Two","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8167f41ca01c8bf0646f87048aaf9e8f90e7d0b65650c0f8eaaf8002b288d6cb?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8167f41ca01c8bf0646f87048aaf9e8f90e7d0b65650c0f8eaaf8002b288d6cb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8167f41ca01c8bf0646f87048aaf9e8f90e7d0b65650c0f8eaaf8002b288d6cb?s=96&d=identicon&r=g","caption":"User Two"},"sameAs":["http:\/\/www.AnalysIR.com","https:\/\/www.facebook.com\/chris.analysir","https:\/\/x.com\/AnalysIR"],"url":"https:\/\/www.analysir.com\/blog\/author\/analysir\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p42zhM-qq","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1682,"url":"https:\/\/www.analysir.com\/blog\/2015\/10\/12\/backdoor-upwm-hack-on-arduino-for-infrared-signals-using-uart\/","url_meta":{"origin":1638,"position":0},"title":"Backdoor uPWM Hack on Arduino for Infrared signals using UART","author":"User Two","date":"October 12, 2015","format":false,"excerpt":"In this blog post we follow up on our recent article about generation of infrared PWM from the Photon's UART where we suggested that it may be possible to achieve something similar with the Arduino. In our previous attempt the Arduino was only able to generate PWM at 40 kHz\u2026","rel":"","context":"In &quot;AnalysIR Blog&quot;","block_context":{"text":"AnalysIR Blog","link":"https:\/\/www.analysir.com\/blog\/analysir-blog\/"},"img":{"alt_text":"Arduino uPWM Circuit Diagram","src":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/Arduino-uPWM-Circuit.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/Arduino-uPWM-Circuit.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/10\/Arduino-uPWM-Circuit.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2560,"url":"https:\/\/www.analysir.com\/blog\/2016\/07\/06\/esp8266-nodemcu-backdoor-upwm-hack-ir-signals-using-uart\/","url_meta":{"origin":1638,"position":1},"title":"ESP8266 NodeMCU Backdoor uPWM Hack for IR signals","author":"User Two","date":"July 6, 2016","format":false,"excerpt":"We received our ESP8266 NodeMCU several months ago it has been difficult to find a working example of Hardware PWM to generate crisp Infrared carrier signals. Most posts we have read suggest that there is no PWM readily available on any of the supported platforms. As we have already shown\u2026","rel":"","context":"In &quot;AnalysIR Blog&quot;","block_context":{"text":"AnalysIR Blog","link":"https:\/\/www.analysir.com\/blog\/analysir-blog\/"},"img":{"alt_text":"ESP8266 NodeMCU uPWM NEC IR Signal","src":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/07\/ESP8266-NodeMCU-uPWM-NEC-IR-Signal.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/07\/ESP8266-NodeMCU-uPWM-NEC-IR-Signal.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/07\/ESP8266-NodeMCU-uPWM-NEC-IR-Signal.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/07\/ESP8266-NodeMCU-uPWM-NEC-IR-Signal.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1996,"url":"https:\/\/www.analysir.com\/blog\/2016\/01\/14\/esp8266-nodemcu-infrared-decoding-added-to-analysir\/","url_meta":{"origin":1638,"position":2},"title":"ESP8266 NodeMCU Infrared decoding added to AnalysIR","author":"User Two","date":"January 14, 2016","format":false,"excerpt":"A few months ago a new user to AnalysIR, from Canada, asked us to assist in adding ESP8266 NodeMCU Infrared decoding over WiFi into\u00a0 AnalysIR. We set about making some upgrades to AnalysIR for this and in double quick time he had AnalysIR accepting IR signals from the ESP8266 over\u2026","rel":"","context":"In &quot;AnalysIR Blog&quot;","block_context":{"text":"AnalysIR Blog","link":"https:\/\/www.analysir.com\/blog\/analysir-blog\/"},"img":{"alt_text":"AnalysIR supports ESP82266 NodeMCU","src":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/01\/NodeMCU.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/01\/NodeMCU.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/01\/NodeMCU.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1964,"url":"https:\/\/www.analysir.com\/blog\/2016\/01\/11\/preview-a-ir-shield-photon-a-high-end-infrared-shield-for-photon-2\/","url_meta":{"origin":1638,"position":3},"title":"Preview: A.IR Shield Photon, a high-end Infrared Shield for AnalysIR","author":"User Two","date":"January 11, 2016","format":false,"excerpt":"The final member of our first MakeIR series of devices & kits is the A.IR Shield Photon. This shield works out of the box with AnalysIR and is essentially plug & play, with additional prototyping options. The shield plugs into a (Particle) Photon with headers or pin-compatible clone. Although designed\u2026","rel":"","context":"In &quot;AnalysIR Blog&quot;","block_context":{"text":"AnalysIR Blog","link":"https:\/\/www.analysir.com\/blog\/analysir-blog\/"},"img":{"alt_text":"A.IR Shield Photon block diagram RevA","src":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/01\/A.IR-Photon-block-diagramRevA.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/01\/A.IR-Photon-block-diagramRevA.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2016\/01\/A.IR-Photon-block-diagramRevA.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1301,"url":"https:\/\/www.analysir.com\/blog\/2015\/06\/16\/porting-analysir-firmware-to-particles-photon-platform\/","url_meta":{"origin":1638,"position":4},"title":"Porting AnalysIR firmware to Particle&#8217;s Photon platform","author":"User Two","date":"June 16, 2015","format":false,"excerpt":"We have just completed porting our (single source) firmware from a range of other 'Arduino' type platforms to Particle's Photon, having received it yesterday & thought it would be useful sharing some of our experiences for other \u2018newbies\u2019. The photon is one of a breed of modern IoT devices hitting\u2026","rel":"","context":"In &quot;AnalysIR Blog&quot;","block_context":{"text":"AnalysIR Blog","link":"https:\/\/www.analysir.com\/blog\/analysir-blog\/"},"img":{"alt_text":"Photon from Particle.io along with embedded sibling","src":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/06\/Photon-1024x481.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/06\/Photon-1024x481.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2015\/06\/Photon-1024x481.jpg?resize=525%2C300 1.5x"},"classes":[]},{"id":3038,"url":"https:\/\/www.analysir.com\/blog\/2017\/01\/29\/updated-esp8266-nodemcu-backdoor-upwm-hack-for-ir-signals\/","url_meta":{"origin":1638,"position":5},"title":"Updated ESP8266 NodeMCU Backdoor uPWM Hack for IR signals","author":"User Two","date":"January 29, 2017","format":false,"excerpt":"In our previous post we showed how to generate stable IR carrier signals using the ESP8266 NodeMCU module. A feature of the original approach was that the output IR signal was inverted and required some additional circuitry to invert it again before transmission. Since the original post we have figured\u2026","rel":"","context":"In &quot;AnalysIR Blog&quot;","block_context":{"text":"AnalysIR Blog","link":"https:\/\/www.analysir.com\/blog\/analysir-blog\/"},"img":{"alt_text":"ESP8266 NodeMCU uPWM IR CIRCUIT 3V3","src":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2017\/01\/ESP8266_NodeMCU_uPWM_IR_CIRCUIT_3V3.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2017\/01\/ESP8266_NodeMCU_uPWM_IR_CIRCUIT_3V3.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2017\/01\/ESP8266_NodeMCU_uPWM_IR_CIRCUIT_3V3.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.analysir.com\/blog\/wp-content\/uploads\/2017\/01\/ESP8266_NodeMCU_uPWM_IR_CIRCUIT_3V3.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/posts\/1638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/comments?post=1638"}],"version-history":[{"count":10,"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/posts\/1638\/revisions"}],"predecessor-version":[{"id":2102,"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/posts\/1638\/revisions\/2102"}],"wp:attachment":[{"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/media?parent=1638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/categories?post=1638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.analysir.com\/blog\/wp-json\/wp\/v2\/tags?post=1638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}