{"id":26,"date":"2014-03-24T00:31:21","date_gmt":"2014-03-24T00:31:21","guid":{"rendered":"http:\/\/blog.mtfwalker.com\/?p=26"},"modified":"2014-03-24T00:31:21","modified_gmt":"2014-03-24T00:31:21","slug":"making-the-same-mistake-twice","status":"publish","type":"post","link":"http:\/\/blog.mtfwalker.com\/?p=26","title":{"rendered":"Making the same mistake twice"},"content":{"rendered":"<p>We all make mistakes &#8211; after all, we&#8217;re only human.\u00a0 The key thing is to learn from them.<\/p>\n<p>I&#8217;ve made a few in my time.\u00a0 Like when I improved my ZX81&#8217;s power supply by adding a linear regulator to drop the voltage so that the computer ran cooler.\u00a0 I also decided to house this new power supply in a metal box which of course had to be earthed.\u00a0 The other problem with the ZX81 was that the programs were loaded by tape and my machine was unreliable.\u00a0 So I came up with the idea of using the speaker output from my hi-fi to improve the drive into the phones socket.\u00a0 It looked good for about 40 seconds\u00a0at which point\u00a0one of the output transistors, which was now shorted to the earth via the new power supply box, went up in a puff of smoke.\u00a0 Needless to say, I knew what had happened immediately and cursed my stupidity.<\/p>\n<p>Although it was slightly less dramatic, years later I came across an odd problem with a customer board.\u00a0 I said in my last post that it&#8217;s ideal to have a proper debugger where you can set breakpoints and so on.\u00a0 However, we also used a debug application that connected via the serial port.\u00a0 A bit like HyperTerminal but with a fancy front-end that gave you access to all of the chips registers and would allow you to navigate various the menu states without having to provide the key presses or infra-red buttons.<\/p>\n<p>On this particular customer&#8217;s board, the serial debug interface was not working and according to the software engineers had never worked.\u00a0 The odd thing is that the serial port appeared to be fine because the customer could use it to flash the code down to the board.\u00a0 It wasn&#8217;t a big issue because the engineers to read the registers by looking at a dump of the memory map but it was definitely more convenient to have the register names rather than the memory addresses, so I wanted to find out why it wasn&#8217;t working.<\/p>\n<p>A look at the customer&#8217;s schematic revealed the issue.\u00a0 The hardware designer, instead of powering the serial port from the supply, had powered it from a GPIO pin of the microcontroller.\u00a0 Presumably he wanted to use the micro to disable or enable the serial interface depending on the state of the GPIO pin.\u00a0 The result was that there was just enough current to be able to flash code down to the board but not enough to handle the different baud rate for debugging.<\/p>\n<p>I cut the track and put a wire straight to the supply and was then able to both flash the code and run the debug interface.<\/p>\n<p>The hardware engineer moved companies, to their largest competitor, where he designed a board with another of our chips.\u00a0 When I came to debug that board, yes you&#8217;ve guessed it, I could flash code but the serial debug interface did not work.\u00a0 He had made the same mistake twice!<\/p>\n<p>Needless to say, when he asked for a recommendation on LinkedIn, I ignored the request.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We all make mistakes &#8211; after all, we&#8217;re only human.\u00a0 The key thing is to learn from them. I&#8217;ve made a few in my time.\u00a0 Like when I improved my ZX81&#8217;s power supply by adding a linear regulator to drop the voltage so that the computer ran cooler.\u00a0 I also decided to house this new &hellip; <a href=\"http:\/\/blog.mtfwalker.com\/?p=26\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Making the same mistake twice&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26"}],"version-history":[{"count":1,"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":27,"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions\/27"}],"wp:attachment":[{"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.mtfwalker.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}