{"id":2715,"date":"2010-01-11T08:02:58","date_gmt":"2010-01-11T16:02:58","guid":{"rendered":"http:\/\/mightyohm.com\/blog\/?p=2715"},"modified":"2015-09-26T11:11:03","modified_gmt":"2015-09-26T18:11:03","slug":"debugging-david-agans","status":"publish","type":"post","link":"https:\/\/mightyohm.com\/blog\/2010\/01\/debugging-david-agans\/","title":{"rendered":"Debugging (David Agans)"},"content":{"rendered":"<p><a href=\"http:\/\/www.amazon.com\/gp\/product\/0814474578?ie=UTF8&amp;tag=mightyohm-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0814474578\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2716\" data-permalink=\"https:\/\/mightyohm.com\/blog\/2010\/01\/debugging-david-agans\/debugging\/\" data-orig-file=\"https:\/\/mightyohm.com\/blog\/wp-content\/uploads\/2009\/12\/debugging.jpg\" data-orig-size=\"348,500\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Debugging by David Agans\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/mightyohm.com\/blog\/wp-content\/uploads\/2009\/12\/debugging.jpg\" src=\"http:\/\/mightyohm.com\/blog\/wp-content\/uploads\/2009\/12\/debugging.jpg\" alt=\"\" title=\"Debugging by David Agans\" width=\"348\" height=\"500\" class=\"alignnone size-full wp-image-2716\" \/><\/a><\/p>\n<p>I recently saw David Agans&#8217; book <em><a href=\"http:\/\/www.amazon.com\/gp\/product\/0814474578?ie=UTF8&amp;tag=mightyohm-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0814474578\">Debugging<\/a><\/em><img loading=\"lazy\" decoding=\"async\" style=\"border: none !important; margin: 0px !important;\" src=\"http:\/\/www.assoc-amazon.com\/e\/ir?t=mightyohm-20&amp;l=as2&amp;o=1&amp;a=0814474578\" border=\"0\" alt=\"\" width=\"1\" height=\"1\" \/> mentioned in one of the many trade journals I receive (I can&#8217;t remember which one).\u00a0 After seeing how much praise it received on amazon.com, I decided to pick up a copy.<\/p>\n<p><em>Debugging<\/em> really spoke to me because a large portion of my career has been devoted to finding and fixing hardware bugs.\u00a0 I finished it in just two or three evenings (it&#8217;s a quick, fun and engaging read).\u00a0 The examples are particularly interesting and relevant to me because many involve issues with embedded systems.\u00a0 Admittedly, perhaps most fascinating is the one about a living room lamp that turned on anytime the author vacuumed the room.<\/p>\n<p>I highly recommend this book to anyone who regularly\u00a0 troubleshoots issues with any kind of system, software or hardware, mechanical or electrical.\u00a0 This includes engineers of all discplines, circuit designers, computer programmers, helpdesk operators, web developers, auto mechanics, etc.<\/p>\n<p>David&#8217;s nine rules of debugging are (with my notes):<\/p>\n<ol>\n<li><strong>Understand the system<\/strong> &#8211; Knowing how your circuit, code, or widget is supposed to work will help you fix it.\u00a0 Read the manual!<\/li>\n<li><strong>Make it fail<\/strong> &#8211; Knowing how to reproduce the failure is critical to being able to fix it.\u00a0 Also, stimulate the failure, don&#8217;t simulate it.<\/li>\n<li><strong>Quit thinking and look<\/strong> &#8211; Don&#8217;t jump to conclusions and just fix what you think <strong>might<\/strong> be the problem.\u00a0 This wastes time when you inevitably guess wrong.\u00a0 Keep an open mind as to what the failure mechanisms could be.<\/li>\n<li><strong>Divide and conquer<\/strong> -Eliminate what is definitely not part of the problem and focus on what&#8217;s left.<\/li>\n<li><strong>Change one thing at a time<\/strong> &#8211; If you change ten things at once, how will you know which one actually solved the problem?<\/li>\n<li><strong>Keep an audit trail<\/strong> &#8211; Being able to reproduce the fix is crucial.\u00a0 Even if you don&#8217;t fix the problem, you might discover a pattern or something you overlooked by looking at your notes.<\/li>\n<li><strong>Check the plug<\/strong> &#8211; When all else fails, check the obvious stuff that you probably should have looked at first.<\/li>\n<li><strong>Get a fresh view<\/strong> &#8211; Someone else may have more experience with the problem than you do or might see the one thing you&#8217;re missing.<\/li>\n<li><strong>If you didn&#8217;t fix it, it ain&#8217;t fixed.<\/strong> &#8211;\u00a0 Don&#8217;t stop when the problem just disappears.\u00a0 It will surely come back later at the most inconvenient time possible.\u00a0 We&#8217;ve all been bitten by this one before.\u00a0 Never again!<\/li>\n<\/ol>\n<p>There&#8217;s even a <a href=\"http:\/\/debuggingrules.com\/Poster_download.html\">free poster<\/a> available on <a href=\"http:\/\/debuggingrules.com\/\">the book&#8217;s website<\/a> to help you remember these rules during your next debugging crisis.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently saw David Agans&#8217; book Debugging mentioned in one of the many trade journals I receive (I can&#8217;t remember which one).\u00a0 After seeing how much praise it received on amazon.com, I decided to pick up a copy. Debugging really spoke to me because a large portion of my career has been devoted to finding &hellip; <a href=\"https:\/\/mightyohm.com\/blog\/2010\/01\/debugging-david-agans\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Debugging (David Agans)<\/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_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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[40],"tags":[132,130,307,188,87,88],"class_list":["post-2715","post","type-post","status-publish","format-standard","hentry","category-books-and-resources","tag-books","tag-circuit-design","tag-electrical-engineering","tag-embedded-systems","tag-hardware","tag-software"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pioCd-HN","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3519,"url":"https:\/\/mightyohm.com\/blog\/2010\/12\/issue-with-rescue-shield-and-targets-with-sut-0ms\/","url_meta":{"origin":2715,"position":0},"title":"Issue with Rescue Shield and targets with SUT = 0ms","author":"Jeff","date":"December 21, 2010","format":false,"excerpt":"HV Rescue Shield 2.0 customer Matthew Beckler has uncovered an issue that affects all variants of the Rescue Shield. Long story short, if the target AVR is configured for a fast internal clock and zero\u00a0startup time (eg. LFUSE=0x62 on the ATtiny13A gives a 9.6MHz clock with 14CK +0ms startup delay),\u2026","rel":"","context":"In &quot;Microcontrollers&quot;","block_context":{"text":"Microcontrollers","link":"https:\/\/mightyohm.com\/blog\/category\/microcontrollers\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2779,"url":"https:\/\/mightyohm.com\/blog\/2010\/01\/garys-wifi-radio-project\/","url_meta":{"origin":2715,"position":1},"title":"Gary&#8217;s Wifi Radio Project","author":"Jeff","date":"January 19, 2010","format":false,"excerpt":"Gary Dion (N4TXI) created a Wifi Radio to match his entertainment center.\u00a0 His project is inspired by my original Wifi Radio project and shares several of the same parts (such as the Asus WL-520gU wireless router) and design philosophy. Interesting features of Gary's version of the radio: Very cool 4\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/mightyohm.com\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mightyohm.com\/blog\/wp-content\/uploads\/2010\/01\/wifiradio5-500x250.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3090,"url":"https:\/\/mightyohm.com\/blog\/2010\/09\/improved-firmware-for-usbtinyisp-fixes-usb-issues-in-virtualbox\/","url_meta":{"origin":2715,"position":2},"title":"Improved firmware for USBTinyISP fixes USB issues","author":"Jeff","date":"September 20, 2010","format":false,"excerpt":"I am a big fan of VirtualBox. \u00a0I have used it in various forms over the past couple years: to run Windows within Linux, Linux within Windows, Linux within OSX, Windows within OSX, etc. \u00a0It is fast, powerful, configurable, and best of all, free. However, there is one major disadvantage\u2026","rel":"","context":"In &quot;Microcontrollers&quot;","block_context":{"text":"Microcontrollers","link":"https:\/\/mightyohm.com\/blog\/category\/microcontrollers\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mightyohm.com\/blog\/wp-content\/uploads\/2010\/09\/virtualbox-500x394.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":148,"url":"https:\/\/mightyohm.com\/blog\/2008\/08\/code-by-charles-petzold\/","url_meta":{"origin":2715,"position":3},"title":"Code, by Charles Petzold","author":"Jeff","date":"August 28, 2008","format":false,"excerpt":"Andrew Milmoe of Make:SF recommended Charles Petzold's book Code to me several months ago to help me refresh my knowledge of computer architecture as I dive into embedded systems development.\u00a0 I finally finished reading it this week and thoroughly enjoyed it.\u00a0 Code is both a history of the computer as\u2026","rel":"","context":"In &quot;Books and Resources&quot;","block_context":{"text":"Books and Resources","link":"https:\/\/mightyohm.com\/blog\/category\/books-and-resources\/"},"img":{"alt_text":"","src":"http:\/\/www.assoc-amazon.com\/e\/ir?t=mightyohm-20&l=as2&o=1&a=0735611319","width":350,"height":200},"classes":[]},{"id":765,"url":"https:\/\/mightyohm.com\/blog\/2008\/12\/makes-2008-open-source-hardware-list\/","url_meta":{"origin":2715,"position":4},"title":"Make&#8217;s 2008 Open Source Hardware List","author":"Jeff","date":"December 10, 2008","format":false,"excerpt":"Make: recently released their 2008 guide to open source hardware - a Christmas list of sorts for hardware geeks. There are lots of cool kits and projects on the list, including a few I hadn't seen before, such as the Fusebox. MAKE: Blog: Open source hardware 2008 - The definitive\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/mightyohm.com\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mightyohm.com\/files\/flickr\/3059738916_2832be684e.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1060,"url":"https:\/\/mightyohm.com\/blog\/2009\/02\/getting-started-with-arduino\/","url_meta":{"origin":2715,"position":5},"title":"Getting Started with Arduino","author":"Jeff","date":"February 6, 2009","format":false,"excerpt":"Getting Started with Arduino, by Massimo Banzi, is the latest physical computing book from O'Reilly and the first dedicated to the wildly popular Arduino microcontoller platform and integrated development environment. Massimo's short text is an excellent introduction to the hardware and software sides of the Arduino and contains a walk-through\u2026","rel":"","context":"In &quot;Books and Resources&quot;","block_context":{"text":"Books and Resources","link":"https:\/\/mightyohm.com\/blog\/category\/books-and-resources\/"},"img":{"alt_text":"Getting Started with Arduino","src":"https:\/\/i0.wp.com\/mightyohm.com\/blog\/wp-content\/uploads\/2009\/01\/51uadcnribl_ss500_.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/posts\/2715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/comments?post=2715"}],"version-history":[{"count":31,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/posts\/2715\/revisions"}],"predecessor-version":[{"id":7846,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/posts\/2715\/revisions\/7846"}],"wp:attachment":[{"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/media?parent=2715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/categories?post=2715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/tags?post=2715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}