{"id":12487,"date":"2016-02-23T09:15:23","date_gmt":"2016-02-23T17:15:23","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=12487"},"modified":"2021-06-16T14:23:58","modified_gmt":"2021-06-16T21:23:58","slug":"using-the-analog-discovery-to-debug-logic-circuits","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/using-the-analog-discovery-to-debug-logic-circuits\/","title":{"rendered":"Using the Analog Discovery To Debug Logic Circuits"},"content":{"rendered":"<p>Last week,\u00a0<a href=\"https:\/\/digilent.com\/blog\/index.php\/getting-started-with-fpgas\/\">Bobby shared his experiences getting back into FPGAs<\/a>. Having once been\u00a0a beginner with FPGAs and then being a TA in an intro to FPGA class, I can say that this is a pretty common struggle.<\/p>\n<p>Bobby also shared some of the resources he found helpful, as well as some tips to increase success. After reading his post it occurred to me what helped me immensely throughout my journey,\u00a0a tool I had throughout my entire intro to FPGA class but didn&#8217;t realize could have helped me until my second FPGA class, the <a href=\"https:\/\/digilent.com\/shop\/analog-discovery-100msps-usb-oscilloscope-logic-analyzer\/\">Analog Discovery<\/a> and <a href=\"https:\/\/digilent.com\/shop\/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply\/\">Analog Discovery 2<\/a>.<\/p>\n<figure id=\"attachment_10821\" aria-describedby=\"caption-attachment-10821\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/digilent.com\/shop\/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply\/\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10821 size-full\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/10\/Analog-Discovery-2-comp-600.png\" alt=\"Analog Discovery 2-comp-600\" width=\"600\" height=\"278\" data-wp-pid=\"10821\" \/><\/a><figcaption id=\"caption-attachment-10821\" class=\"wp-caption-text\">The Analog Discovery and Analog Discovery 2.<\/figcaption><\/figure>\n<p>For an entire year, I had no idea what the Analog Discovery and\u00a0<a href=\"https:\/\/digilent.com\/shop\/waveforms-2015-download-only\/\">Waveforms 2015<\/a>\u00a0were capable of\u00a0when it comes to digital logic design.<\/p>\n<p>I quickly recognized\u00a0all the fly-wires (or the pin-out on the Analog Discovery) that I knew from my analog circuits classes. The waveform generators, ground, oscilloscopes, and power supplies &#8212; they&#8217;re all there! If you look to the right of those, there is a whole set of fly-wires that I wasn&#8217;t familiar with. Well, those are the digital inputs.<\/p>\n<figure id=\"attachment_12513\" aria-describedby=\"caption-attachment-12513\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/digilent.com\/reference\/_media\/analog_discovery:analog_discovery_pinout.pdf\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-12513 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/linout-600x516.jpg\" alt=\"linout\" width=\"600\" height=\"516\" data-wp-pid=\"12513\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/linout-600x516.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/linout-110x96.jpg 110w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/linout.jpg 724w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-12513\" class=\"wp-caption-text\">The Analog Discovery pin-out diagram. Notice the digital inputs on the right.<\/figcaption><\/figure>\n<p>Waveforms 2015 contains a tool called the logic analyzer. This allows you to view the digital signals being sent out of your FPGA in real time. This way you can see if what you think you are sending, is what you are actually sending.<\/p>\n<p>Due to an unfortunate combination of illness and procrastination, I had to finish most of my EE324 (Digital Logic Circuits 2) labs in a period of about two weeks. I can tell you, that without the Analog Discovery and Logic Analyzer, I would not have been able to accomplish such a feat.<\/p>\n<p>About a week or so in, I was in the lab, probably around one in the morning working on my SPI controller. Despite thinking that my SPI controller was working, nothing was coming out of the <a href=\"https:\/\/digilent.com\/shop\/pmodmic3-mems-microphone-with-adjustable-gain\/\">PmodMIC3<\/a>. Imagine my frustration, and concern. Not a great combination for clear thinking.<\/p>\n<p>Luckily, one of my friends who\u00a0happened to be in the lab late (it happens more often than you would think) had an Analog Discovery, and suggested that I scope my signals.<\/p>\n<p>So, I plugged in the Analog Discovery&#8217;s digital inputs to MISO, SCLK, and CS. Imagine my shock when I discovered that SCLK wasn&#8217;t outputting anything. I probably wouldn&#8217;t have discovered this nearly as quickly without seeing the output live.<\/p>\n<p>I looked back at my code and discovered that I had set SCLK to an input rather than an output. I know, a total &#8220;facepalm moment&#8221;, but give me a break! it was one in the morning.<\/p>\n<p>So, I changed that pin to an output, and it worked perfectly! The Analog Discovery&#8217;s logic analyzer saved the day.<\/p>\n<figure id=\"attachment_12514\" aria-describedby=\"caption-attachment-12514\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.instructables.com\/id\/Using-the-Analog-Discovery-to-Debug-Digital-Logic\/\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-12514 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/cover-600x598.png\" alt=\"cover\" width=\"600\" height=\"598\" data-wp-pid=\"12514\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/cover-600x598.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/cover-150x150.png 150w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/cover-768x765.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/cover-300x300-cropped.png 300w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/cover.png 769w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-12514\" class=\"wp-caption-text\">A shot from Waveforms 2015 showing the SPI signals.<\/figcaption><\/figure>\n<p>Imagine how much faster I could have fixed my other projects if I had known all along. I wanted to share this experience with all of you who follow the blog to hopefully save someone else some frustration.<\/p>\n<p>To learn how to use the logic analyzer, check out my <a href=\"http:\/\/www.instructables.com\/id\/Using-the-Analog-Discovery-to-Debug-Digital-Logic\">Instructable on using the logic analyzer on the Analog Discovery 2<\/a>. To learn more about the <a href=\"https:\/\/digilent.com\/shop\/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply\/\">Analog Discovery 2<\/a>\u00a0or <a href=\"https:\/\/digilent.com\/shop\/waveforms-2015-download-only\/\">Waveforms 2015<\/a> themselves, check out their respective resource centers.<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-12487 jlk' data-task='like' data-post_id='12487' data-nonce='ee750c7abc' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-12487 lc'>+1<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-12487 jlk' data-task='unlike' data-post_id='12487' data-nonce='ee750c7abc' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-12487 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-12487 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Making things easier one circuit at a time with the Analog Discovery 2.<\/p>\n","protected":false},"author":18,"featured_media":12514,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4325,4323,4312,1563],"tags":[111],"ppma_author":[4466],"class_list":["post-12487","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debug-validation-test","category-software","category-usb-scopes-analyzers-generators","category-guide","tag-analog-discovery"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/02\/cover.png","authors":[{"term_id":4466,"user_id":18,"is_guest":0,"slug":"kaitlyn","display_name":"Kaitlyn Franz","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/3f16f6159d3666c6fd05a4b73a18c286?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Franz","last_name_2":"","first_name":"Kaitlyn","first_name_2":"","job_title":"","description":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/12487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=12487"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/12487\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/12514"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=12487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=12487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=12487"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=12487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}