{"id":82,"date":"2014-06-20T01:49:15","date_gmt":"2014-06-20T01:49:15","guid":{"rendered":"http:\/\/www.embeditelectronics.com\/blog\/?p=82"},"modified":"2014-08-27T00:35:23","modified_gmt":"2014-08-27T04:35:23","slug":"rethinking-digital-logic-with-the-rpisoc","status":"publish","type":"post","link":"https:\/\/embeditelectronics.com\/blog\/rpisoc\/rethinking-digital-logic-with-the-rpisoc\/","title":{"rendered":"Rethinking Digital Logic with the RPiSoC"},"content":{"rendered":"<p>For any Engineers out there, I&#8217;m sure you remember the unending tedium of Digital Electronics. First you\u00a0have to commit to learning the principles of combinational and sequential logic through the use of logic gates, latches, flip flops, counters, adders, comparators, multiplexing, timing analysis, minimization, boolean algebra, and the list just goes on and on.\u00a0Then (as if that wasn&#8217;t enough already) you\u00a0had to learn how to use a myriad of simulation tools and software to see if your designs even worked. But that wasn&#8217;t even the end of it, because the worst part of all is that lab time is\u00a0almost entirely wasted building something that looks like this&#8230;<\/p>\n<p><a href=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/2013-12-04-17.48.11.jpg\"><img loading=\"lazy\" class=\"wp-image-83 aligncenter\" src=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/2013-12-04-17.48.11.jpg\" alt=\"2013-12-04 17.48.11\" width=\"538\" height=\"720\" srcset=\"https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/2013-12-04-17.48.11.jpg 1936w, https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/2013-12-04-17.48.11-224x300.jpg 224w, https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/2013-12-04-17.48.11-1529x2048.jpg 1529w\" sizes=\"(max-width: 538px) 100vw, 538px\" \/><\/a><\/p>\n<p>Yes, that is an actual circuit I had to build as a Sophomore Electrical Engineering student, and no, it did not even do anything special. It was a four floor elevator (that only went up.) Not to mention, the clock was too fast,\u00a0the output was in Binary instead of Decimal, so the results weren&#8217;t even tangible. The input even required entering the desired floor in binary using switches, instead of just being able to hit a button for the desired floor, because implementation of that logic on a breadboard would be too messy. I think I&#8217;d rather take the stairs than deal with all that&#8230;<\/p>\n<p>This project took all of twenty minutes to design, an hour to simulate, and 3 weeks of agony to build and debug on a breadboard. Needless to say, this brings back nightmares.<\/p>\n<p>So we at Embedit were thinking&#8211; What if there is a better way? What if you could go straight from design to tangible results? What if you could actually take the time to design complex projects, without having to worry about translation to a messy breadboard? And what if you could do all this, and still get that tangible, real output like you would with a traditional breadboard? With the RPiSoC, you can do just that.<\/p>\n<p>Sequential Logic for determining the desired floor using push-buttons instead of binary numbers as inputs? Easy<\/p>\n<p><a href=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/PSoC_desired_floor.png\"><img loading=\"lazy\" class=\"wp-image-84 aligncenter\" src=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/PSoC_desired_floor.png\" alt=\"PSoC_desired_floor\" width=\"1080\" height=\"563\" srcset=\"https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/PSoC_desired_floor.png 1150w, https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/PSoC_desired_floor-300x156.png 300w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/><\/a><\/p>\n<p>Want to implement a custom 3-bit bi-directional counter without overflow, straight from your transition table? Sure.<\/p>\n<p><a href=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/State_Machine_Counter_PSoC.png\"><img loading=\"lazy\" class=\"wp-image-85 aligncenter\" src=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/State_Machine_Counter_PSoC.png\" alt=\"State_Machine_Counter_PSoC\" width=\"1080\" height=\"585\" srcset=\"https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/State_Machine_Counter_PSoC.png 1150w, https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/State_Machine_Counter_PSoC-300x162.png 300w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/><\/a><\/p>\n<p>How about a minimized 3-bit magnitude comparator using combinational logic? No problem.<\/p>\n<p><a href=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/Comparator_PSoC.png\"><img loading=\"lazy\" class=\"wp-image-86 aligncenter\" src=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/Comparator_PSoC.png\" alt=\"Comparator_PSoC\" width=\"1080\" height=\"562\" srcset=\"https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/Comparator_PSoC.png 1154w, https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/Comparator_PSoC-300x156.png 300w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/><\/a><\/p>\n<p>The result? A simulated 7 floor elevator that can go up AND\u00a0down (at speeds between 1Hz and 67 MHz, so hold on tight).<\/p>\n<p><a href=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/elevator.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-206\" src=\"http:\/\/www.embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/elevator.png\" alt=\"elevator\" width=\"742\" height=\"374\" srcset=\"https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/elevator.png 742w, https:\/\/embeditelectronics.com\/blog\/wp-content\/uploads\/2014\/06\/elevator-300x151.png 300w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Results are being displayed on a TFT screen right now (because we don&#8217;t have any hex displays lying around and we figured virtual ones would be even cooler), but other than that, there is absolutely no C-code.\u00a0The design is entirely schematic based, and it was easy to make using the PSoC Creator GUI. Not to mention it barely put a dent in our boards resources. Even with the screen (which sucks up some of the digital resources\u00a0because it is SPI-driven, and SPI is implemented using PLD on the PSoC) we are barely using 10% of our digital blocks, and less than a quarter of our PLD. So, we can have programs MUCH more complex than this running without having to worry about wasting precious clock cycles of our\u00a0CPU.<\/p>\n<p>Imagine how\u00a0much\u00a0time (and headaches) will be saved without the dreaded breadboard! That is the power of the PSoC.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For any Engineers out there, I&#8217;m sure you remember the unending tedium of Digital Electronics. First you\u00a0have to commit to learning the principles of combinational and sequential logic through the use of logic gates, latches, flip flops, counters, adders, comparators, multiplexing, timing analysis, minimization, boolean algebra, and the list just goes on and on.\u00a0Then (as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,7,8],"tags":[],"_links":{"self":[{"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/posts\/82"}],"collection":[{"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/comments?post=82"}],"version-history":[{"count":10,"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":207,"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/posts\/82\/revisions\/207"}],"wp:attachment":[{"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embeditelectronics.com\/blog\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}