{"id":21807,"date":"2018-03-18T08:00:15","date_gmt":"2018-03-18T15:00:15","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=21807"},"modified":"2021-06-09T14:57:06","modified_gmt":"2021-06-09T21:57:06","slug":"debugging-with-the-digital-discovery","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/debugging-with-the-digital-discovery\/","title":{"rendered":"Debugging With The Digital Discovery!"},"content":{"rendered":"<p>Recently Arthur was working on a demo for the <a href=\"https:\/\/digilent.com\/shop\/pmod-jstk2-two-axis-joystick\/\">Pmod JSTK2<\/a> IP core. However, due to unforseen (and un-seeable!) difficulties he was unable to get it working. To make the issue even worse, the software thought that the demo <em>was<\/em> working, and SPI requests would return data that made no sense when looking at the reference manual.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-21978\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085157-600x450.jpg\" alt=\"\" width=\"600\" height=\"450\" data-wp-pid=\"21978\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085157-600x450.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085157-768x576.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085157-1024x768.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085157-800x600.jpg 800w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>He decided he needed a way to peek inside the demo and figure out what was really going on. Fortunately, the <a href=\"https:\/\/digilent.com\/shop\/digital-discovery-portable-logic-analyzer-and-digital-pattern-generator\/\">Digital Discovery<\/a> was there to help him do just that!<\/p>\n<p>He hooked up\u00a0a <a href=\"https:\/\/digilent.com\/shop\/digital-discovery-portable-logic-analyzer-and-digital-pattern-generator\/\">Digital Discovery<\/a> to a <a href=\"https:\/\/digilent.com\/shop\/pmod-tph2-12-pin-test-point-header\/\">Pmod TPH<\/a> between the JSTK2 and Pmod header on the <a href=\"https:\/\/digilent.com\/shop\/zybo-zynq-7000-arm-fpga-soc-trainer-board\/\">Zybo<\/a>. He then noticed when examining the waveforms that were being generated from the Zybo that the chip select signal (which was supposed to be held low during an entire multi-byte transfer) was being brought high by the drivers. This pointed him in the right direction, but after a temporary fix he started\u00a0getting a different set of errors.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-21980\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/wave-600x325.png\" alt=\"\" width=\"600\" height=\"325\" data-wp-pid=\"21980\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/wave-600x325.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/wave-768x416.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/wave-1024x555.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/wave-800x433.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/wave.png 1920w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>This time the data was still mal-formed, but in a different pattern. After a review of the<a href=\"https:\/\/digilent.com\/reference\/pmod\/pmodjstk2\/reference-manual\"> data sheet <\/a>for the <a href=\"https:\/\/digilent.com\/shop\/pmod-jstk2-two-axis-joystick\/\">Pmod <\/a><a href=\"https:\/\/digilent.com\/shop\/pmod-jstk2-two-axis-joystick\/\">JSTK2<\/a> he took another look at the project using the Digital Discovery again. He noticed that\u00a0the SPI\u00a0clock signal to the <a href=\"https:\/\/digilent.com\/shop\/pmod-jstk2-two-axis-joystick\/\">JSTK2<\/a> was supposed to be less than 1MHz, where he was sending it a 13 MHz clock.<\/p>\n<p>The <a href=\"https:\/\/digilent.com\/shop\/digital-discovery-portable-logic-analyzer-and-digital-pattern-generator\/\">Digital Discovery<\/a> allowed him to\u00a0check the timing of the signals, pulse width and frequency with ease, which in turn led him right to the problem. After fixing the clock signal issue in Vivado and cleaning up the timings of the chip select signal (using the Digital Discovery to confirm that the minimum hold times for the signal were being met) he hovered over the chip select to make sure that the high-time was greater than 25us. He discovered that the high-time was now 25.40- perfect!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-21977\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085153-600x450.jpg\" alt=\"\" width=\"600\" height=\"450\" data-wp-pid=\"21977\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085153-600x450.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085153-768x576.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085153-1024x768.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085153-800x600.jpg 800w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>To quote Arthur&#8217;s thoughts on his debugging experience:<\/p>\n<blockquote><p>This is the type of bug that would have taken a lot of very tedious step by step debugging in SDK to solve without being able to just glance at the actual waveforms that are being sent back and forth. To reiterate the first point, I find the Digital Discovery most helpful in situations where the software thinks that there is nothing wrong, but when there is still very clearly something wrong.<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-21979\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085305-600x450.jpg\" alt=\"\" width=\"600\" height=\"450\" data-wp-pid=\"21979\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085305-600x450.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085305-768x576.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085305-1024x768.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085305-800x600.jpg 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085305-1200x900-cropped.jpg 1200w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>We love seeing the Digital Discovery help people make their projects a reality.\u00a0Feel free to tell us the story in the comments below of your most memorable or recent debugging experience, and how you solved (or are working on solving) the problem! If you want to<a href=\"https:\/\/digilent.com\/blog\/a-hands-on-test-of-the-digital-discovery\/\">\u00a0learn more <\/a>about the<a href=\"https:\/\/digilent.com\/blog\/new-product-announcement-digital-discovery\/\"> Digital Discovery<\/a> or see <a href=\"https:\/\/digilent.com\/blog\/i-have-an-analog-discovery-do-i-need-a-digital-discovery\/\">how it compares to the Analog Discovery,<\/a> check out the links above and the <a href=\"https:\/\/digilent.com\/reference\/instrumentation\/digital-discovery\/start\">resource center<\/a>!<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-21807 jlk' data-task='like' data-post_id='21807' data-nonce='e5335d04d0' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-21807 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-21807 jlk' data-task='unlike' data-post_id='21807' data-nonce='e5335d04d0' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-21807 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-21807 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Arthur recounts his debugging journey and how the Digital Discovery helped him track down and squash a bug!<\/p>\n","protected":false},"author":36,"featured_media":21979,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4325,4312,35,1563],"tags":[1662],"ppma_author":[4485],"class_list":["post-21807","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debug-validation-test","category-usb-scopes-analyzers-generators","category-fpga","category-guide","tag-fpga"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/08\/20170808_085305.jpg","authors":[{"term_id":4485,"user_id":36,"is_guest":0,"slug":"mirandamay7","display_name":"Miranda Hansen","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/9bae943b615ddb1dedee72ccb219b464?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Hansen","last_name_2":"","first_name":"Miranda","first_name_2":"","job_title":"","description":"I enjoy creative writing, engineering, thinking, building, exploring and sharing with people.\r\nHuge aficionado of spending time thinking about things that \u201cdon\u2019t matter.\u201d \r\n I am very interested in unconstrained creativity. I love cross-discipline ideas and all of their integration into complete original systems.\r\n\r\nAnd I like things that do things."}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/21807","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\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=21807"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/21807\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/21979"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=21807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=21807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=21807"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=21807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}