{"id":9341,"date":"2020-11-01T11:07:34","date_gmt":"2020-11-01T11:07:34","guid":{"rendered":"https:\/\/wolles-elektronikkiste.de\/debugging-for-the-arduino-uno-with-atmel-studio"},"modified":"2020-11-29T12:14:59","modified_gmt":"2020-11-29T12:14:59","slug":"debugging-for-the-arduino-uno-with-atmel-studio","status":"publish","type":"post","link":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio","title":{"rendered":"Debugging for the Arduino UNO with Atmel Studio"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">About the post<\/h2>\n<p>In my <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/atmel-studio-7-an-introduction?lang=en\" target=\"_blank\" rel=\"noopener noreferrer\">last post<\/a> I gave a quick introduction to Atmel Studio 7. The ability to debug is a big advantage over the Arduino IDE when working with Atmel Studio. Programming in C, on the other hand, can be a little daunting for die-hard Arduino followers. Some people would probably like to continue using the Arduino UNO and the &#8220;Arduino language&#8221; but still want to be able to use debugging for the Arduino. The good news:<\/p>\r\n<ul>\r\n<li>it&#8217;s possible, you can program the Arduino UNO with Atmel Studio<\/li>\r\n<li>you can import existing Arduino sketches<\/li>\r\n<li>you can track variables, run the sketch step by step and set breakpoints<\/li>\r\n<\/ul>\r\n<p>And what&#8217;s the bad news?<\/p>\r\n<ul>\r\n<li>you need a programmer which supports debugging, and these are not quite cheap<\/li>\r\n<li>a small hardware intervention on the Arduino is necessary, which you have to undo if you want to program again using the Arduino IDE<\/li>\r\n<li>if the Arduino sketch contains libraries, there are a few things to keep in mind depending on the type of library<\/li>\r\n<\/ul>\r\n<p>How to install Atmel Studio, I described in my <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/atmel-studio-7-an-introduction?lang=en\" target=\"_blank\" rel=\"noopener noreferrer\">last post<\/a>. I had introduced various programmers for Atmel Studio in my <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/programmer-for-atmel-studio?lang=en\" target=\"_blank\" rel=\"noopener noreferrer\">penultimate post<\/a>. Both topics are therefore omitted here. <\/p>\r\n\n<h2 class=\"wp-block-heading\">Preparation of debugging for the Arduino Uno <\/h2>\n<p><em>Note: it&#8217;s best to read the whole post first<\/em><em> and then decide whether you want to perform the following procedure. There is a potential risk that you will not be able to undo it. In this case, you will no longer be able to use the Arduino with the Arduino IDE. <br><\/em><\/p>\r\n<p>The way the Arduino UNO or the Arduino IDE handles the reset on the ATMega328P is unfortunately incompatible with Atmel Studio, which is related to the special bootloader of the Arduino. This would not be a problem in itself, as you can overwrite bootloaders, but this special feature has consequences for the wiring on the Arduino UNO board. However, it is quite easy to overcome this hurdle.<\/p>\r\n<p>If you look at your Arduino UNO, you will find two soldering points in a white bordered area with the label &#8220;RESET EN&#8221; to the right of the 16 MHz oscillator. If you take a closer look, you will see that the two soldering points are connected with a small connection line. You have to cut this connection with a razor, scalpel or similar (caution!). Because I was impatient and had nothing else on hand, I took a not entirely new cutter knife. It worked, but is actually too rough. <\/p>\r\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Reset_EN.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"820\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Reset_EN-1024x820.jpg\" alt=\"Debugging for the Arduino requires a small cut. \" class=\"wp-image-8100\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Reset_EN-1024x820.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Reset_EN-300x240.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Reset_EN-768x615.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Reset_EN-1320x1058.jpg 1320w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>The connection between the soldering points must be cut<\/figcaption><\/figure><\/div>\n\n<h4 class=\"wp-block-heading\">How do I undo that?<\/h4>\n<p>There are three possibilities:<\/p>\r\n<ol>\r\n<li>Of course, you can simply solder the soldering points. However, this is not very convenient if you do this multiple times.<\/li>\r\n<li>I&#8217;ve seen in some posts that very skillful people have soldered two pins, which they connected with a jumper cap as needed.<\/li>\r\n<li>Not at all. You invest in a second Arduino UNO, which is only used for Atmel Studio. I chose this variant. After all, you get this device for less than ten euros. In addition, you have to replace the bootloader for each change (see below) and this is too tedious for me. <\/li>\r\n<\/ol>\r\n\n<h4 class=\"wp-block-heading\">Not all UNO versions or clones work<\/h4>\n<p>Debugging for the Arduino using Atmel Studio only works on the hardware side with the UNOs, which have the dip variant of the ATmega328P. With the following variant it is not possible or at least I do not know how it works:<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/UNO_2.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"733\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/UNO_2-1024x733.jpg\" alt=\"Debugging for the Arduino only works with models having the DIP28 versions of the ATmega328P.\" class=\"wp-image-8135\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/UNO_2-1024x733.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/UNO_2-300x215.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/UNO_2-768x549.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/UNO_2-1320x944.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/UNO_2.jpg 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>With this Arduino UNO version, programming via Atmel Studio (to my best knowledge) is not possible<\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\">An application example <\/h2>\n<p>In a practical example, I want to show step-by-step how to import a sketch including libraries into Atmel Studio.<\/p>\r\n\n<h3 class=\"wp-block-heading\">Different types of libraries<\/h3>\n<p>A simple Arduino Sketch without libraries can be uploaded to the Arduino UNO quite easily with Atmel Studio 7. For example, there is a <a href=\"https:\/\/www.youtube.com\/watch?v=7WnOe00dVu0\" target=\"_blank\" rel=\"noopener noreferrer\">Youtube video<\/a> by Microchip (to which Atmel belongs). Including libraries is actually easy &#8211; if you know what to look out for. The first point to consider is that there are different libraries. On the one hand, these are those in line with the <a href=\"https:\/\/github.com\/arduino\/Arduino\/wiki\/Arduino-IDE-1.5:-Library-specification\" target=\"_blank\" rel=\"noopener noreferrer\">Arduino specification for libraries<\/a>. They can be identified, for example, in the fact that in addition to the &#8220;.h&#8221; and &#8220;.cpp&#8221; files, there is also a file called &#8220;library.properties&#8221;. Other libraries, which consist only of &#8220;.h&#8221; and &#8220;.cpp&#8221; files, can also be included, but in a different way. Such libraries are mostly older, not specifically designed for Arduino or the author was too lazy.<\/p>\r\n\n<h3 class=\"wp-block-heading\">An example sketch<\/h3>\n<p>In my sample sketch, LEDs are switched at port A of an MCP23017 port expander. The sketch uses the Wire library because the MCP23017 is addressed by I2C. In addition, the sketch uses a self-written library (MCP23017) that does not meet the Arduino specification (update: that has change meanwhile! &#8211; But it still shows the principle and I did not find the time yet to take a different example). The library still works smoothly within the Arduino IDE.<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-group=\"MCP23017_example.ino\" data-enlighter-title=\"MCP23017_example.ino\">#define\u00a0MCP_ADDRESS\u00a00x20\u00a0\/\/\u00a0(A2\/A1\/A0\u00a0=\u00a0LOW)\u00a0\r\n#include\u00a0&lt;Wire.h&gt;\u00a0\r\n#include\u00a0&lt;MCP23017.h&gt;\u00a0\r\nMCP23017\u00a0myMCP(MCP_ADDRESS,5);\u00a0\r\nint\u00a0wT\u00a0=\u00a01000;\u00a0\/\/\u00a0wT\u00a0=\u00a0waiting\u00a0time\r\n\r\nvoid\u00a0setup(){\u00a0\r\n\u00a0\u00a0Wire.begin();\r\n\u00a0\u00a0myMCP.Init();\u00a0\u00a0\r\n\u00a0\u00a0myMCP.setPortMode(B11111111,\u00a0A);\u00a0\r\n\u00a0\u00a0delay(wT);\r\n}\r\n\r\nvoid\u00a0loop(){\u00a0\r\n\u00a0\u00a0myMCP.setAllPins(A,\u00a0ON);\u00a0\r\n\u00a0\u00a0delay(wT);\r\n\u00a0\u00a0myMCP.setAllPins(A,\u00a0OFF);\r\n\u00a0\u00a0delay(wT);\r\n\u00a0\u00a0myMCP.setPin(0,\u00a0A,\u00a0ON);\u00a0\r\n\u00a0\u00a0delay(wT);\u00a0\r\n\u00a0\u00a0myMCP.setPin(4,\u00a0A,\u00a0ON);\r\n\u00a0\u00a0delay(wT);\r\n\u00a0\u00a0myMCP.setPin(7,\u00a0A,\u00a0ON);\u00a0\r\n\u00a0\u00a0delay(wT);\r\n}<\/pre>\r\n<p>&nbsp;<\/p>\n<h3 class=\"wp-block-heading\">The wiring for the example sketch<\/h3>\n<p>It is only important to explain the principle of the import, but for the sake of completeness here is the wiring for the example:<\/p>\r\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/ArduImport_Schaltung.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"716\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/ArduImport_Schaltung-1024x716.png\" alt=\"Debugging for the Arduino - Fritzing scheme of the example&#13;&#10;\" class=\"wp-image-8101\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/ArduImport_Schaltung-1024x716.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/ArduImport_Schaltung-300x210.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/ArduImport_Schaltung-768x537.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/ArduImport_Schaltung.png 1229w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>Example circuit<\/figcaption><\/figure><\/div>\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20190628_160317.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20190628_160317-1024x471.jpg\" alt=\"Debugging for the Arduino - example circuit with AVR Dragon as programmer\" class=\"wp-image-8102\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20190628_160317-1024x471.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20190628_160317-300x138.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20190628_160317-768x353.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20190628_160317-1320x607.jpg 1320w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>Example circuit with AVR Dragon as programmer<\/figcaption><\/figure><p>If you want to replicate exactly this example, then <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/port-expander-mcp23017-2?lang=en\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> is the link to my post in which I deal with the MCP23017 and the library. You can also download the library directly from Github <a href=\"https:\/\/github.com\/wollewald\/MCP23017_WE\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. Alternatively, of course, you can choose any other sketch that contains libraries.<\/p>\r\n<p>I will be revising the MCP23017 library soon to meet the specification (update: done). If you still want to follow this example, simply rename the file &#8220;library.properties&#8221; in the meantime so that Atmel Studio no longer identifies it as an Arduino library.<\/p>\r\n\n<h2 class=\"wp-block-heading\">Importing the sketch and libraries into Atmel Studio<\/h2>\n<p>Enough of the preparations, now it&#8217;s time to use Atmel Studio 7. First, you start a new project.<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/1-NewProject.png\"><img loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"479\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/1-NewProject.png\" alt=\"Debugging for the Arduino - Create a new project in Atmel Studio\" class=\"wp-image-8103\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/1-NewProject.png 786w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/1-NewProject-300x183.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/1-NewProject-768x468.png 768w\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" \/><\/a><\/figure><p>In the next step, choose &#8220;Create Project from Arduino Sketch&#8221; and give the project a name (later renaming is more complex than you might think).<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/2-Create_project_from_Arduino.png\"><img loading=\"lazy\" decoding=\"async\" width=\"941\" height=\"654\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/2-Create_project_from_Arduino.png\" alt=\"Debugging for the Arduino - select the option of the Arduino sketch import\" class=\"wp-image-8104\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/2-Create_project_from_Arduino.png 941w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/2-Create_project_from_Arduino-300x209.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/2-Create_project_from_Arduino-768x534.png 768w\" sizes=\"auto, (max-width: 941px) 100vw, 941px\" \/><\/a><\/figure><p>Select the sketch, i.e. the &#8220;.ino&#8221; file and the board.&nbsp;<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/3-Sketch_und_Board_aussuchen.png\"><img loading=\"lazy\" decoding=\"async\" width=\"589\" height=\"309\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/3-Sketch_und_Board_aussuchen.png\" alt=\"Debugging for the Arduino - Selection of the sketch to import\" class=\"wp-image-8105\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/3-Sketch_und_Board_aussuchen.png 589w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/3-Sketch_und_Board_aussuchen-300x157.png 300w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/a><\/figure><p>It takes a little, then the sketch is imported and appears with a few comments generated by Atmel Studio. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4-Der_Sketch_im_Studio.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1002\" height=\"709\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4-Der_Sketch_im_Studio.png\" alt=\"Debugging for the Arduino - the selected sketch in the Atmel Studio program editor\" class=\"wp-image-8106\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4-Der_Sketch_im_Studio.png 1002w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4-Der_Sketch_im_Studio-300x212.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4-Der_Sketch_im_Studio-768x543.png 768w\" sizes=\"auto, (max-width: 1002px) 100vw, 1002px\" \/><\/a><\/figure><p>If you didn&#8217;t have to include the two libraries, you&#8217;d be ready now! Try &#8220;Build Solution&#8221;: <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/12_Build_Solution.png\"><img loading=\"lazy\" decoding=\"async\" width=\"689\" height=\"184\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/12_Build_Solution.png\" alt=\"Build Solution\" class=\"wp-image-8119\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/12_Build_Solution.png 689w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/12_Build_Solution-300x80.png 300w\" sizes=\"auto, (max-width: 689px) 100vw, 689px\" \/><\/a><\/figure><p>You will receive the following error message:&nbsp;<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4b-Der_Sketch_im_Studio.png\"><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"148\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4b-Der_Sketch_im_Studio.png\" alt=\"Error message - Wire.h library is missing. \" class=\"wp-image-8107\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4b-Der_Sketch_im_Studio.png 738w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/4b-Der_Sketch_im_Studio-300x60.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/a><\/figure>\n<h2 class=\"wp-block-heading\">Including libraries<\/h2>\n\n<h3 class=\"wp-block-heading\">Include specification-compliant libraries<\/h3>\n\n<p>In the first step, the Wire library is integrated. To do this, you go into the Solution Explorer window and right-click on the entry that with the name of the included Arduino Sketch.<\/p>\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/5-SolutionExplorer.png\"><img loading=\"lazy\" decoding=\"async\" width=\"242\" height=\"321\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/5-SolutionExplorer.png\" alt=\"Selecting the sketch in Solution Explorer\" class=\"wp-image-8108\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/5-SolutionExplorer.png 242w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/5-SolutionExplorer-226x300.png 226w\" sizes=\"auto, (max-width: 242px) 100vw, 242px\" \/><\/a><\/figure><\/div>\n<p>Then choose &#8220;Add Arduino Library&#8221;&#8230;&nbsp;<\/p>\r\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/6-Add_Arduino_Lib.png\"><img loading=\"lazy\" decoding=\"async\" width=\"449\" height=\"619\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/6-Add_Arduino_Lib.png\" alt=\"Add Arduino library\" class=\"wp-image-8109\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/6-Add_Arduino_Lib.png 449w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/6-Add_Arduino_Lib-218x300.png 218w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/a><\/figure><\/div>\n<p>&#8230; and in the next step, tick &#8220;Wire&#8221; in the shortlist. Only the compliant libraries appear in this list. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7-Select_Wire_under_AVR.png\"><img loading=\"lazy\" decoding=\"async\" width=\"588\" height=\"309\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7-Select_Wire_under_AVR.png\" alt=\"Selecting the Wire library from the library list \" class=\"wp-image-8111\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7-Select_Wire_under_AVR.png 588w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7-Select_Wire_under_AVR-300x158.png 300w\" sizes=\"auto, (max-width: 588px) 100vw, 588px\" \/><\/a><\/figure><p>If you go to Build Solution again, the MCP23017 library will be missed as expected.&nbsp;<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7b-jetzt_fehlt_MCP23017-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"942\" height=\"150\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7b-jetzt_fehlt_MCP23017-1.png\" alt=\"The MCP23017 library is missing\" class=\"wp-image-8113\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7b-jetzt_fehlt_MCP23017-1.png 942w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7b-jetzt_fehlt_MCP23017-1-300x48.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/7b-jetzt_fehlt_MCP23017-1-768x122.png 768w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/a><\/figure>\n<h3 class=\"wp-block-heading\">Include non-conforming libraries <\/h3>\n<p>In this case, you go back to the Solution Explorer window and right-click on the entry with the Arduino sketch name. Then select &#8220;Add&#8221; and then &#8220;Existing Item&#8230;&#8221;. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/8-Add_existing_item.png\"><img loading=\"lazy\" decoding=\"async\" width=\"729\" height=\"537\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/8-Add_existing_item.png\" alt=\"Selection of non-compliant libraries\" class=\"wp-image-8110\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/8-Add_existing_item.png 729w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/8-Add_existing_item-300x221.png 300w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><\/a><\/figure><p>Now you navigate to the directory where your library is located. Select the &#8220;.cpp&#8221; and &#8220;.h&#8221; files. If you click on the &#8220;Add&#8221; button at the bottom right, you can choose between &#8220;Add&#8221; and &#8220;Add As Link&#8221;. Both have their advantages and disadvantages. &#8220;Add As Link&#8221; is more space-saving, and you will always include the latest version of the library. But sometimes there are reasons why you might not want to do that. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9-Add_h_und_cpp.png\"><img loading=\"lazy\" decoding=\"async\" width=\"946\" height=\"399\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9-Add_h_und_cpp.png\" alt=\"Selection of the h and cpp files of the library\" class=\"wp-image-8114\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9-Add_h_und_cpp.png 946w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9-Add_h_und_cpp-300x127.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9-Add_h_und_cpp-768x324.png 768w\" sizes=\"auto, (max-width: 946px) 100vw, 946px\" \/><\/a><\/figure><p>If you select &#8220;Add&#8221; then you can see the imported files in Solution Explorer, if you select &#8220;Add As Link&#8221;, then you will see the links:<\/p>\r\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"255\" height=\"191\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/10_files_sind_da.png\" alt=\"Imported libraries\" class=\"wp-image-8115\"\/><figcaption>MCP23017.h and MCP23017.cpp are located in the &#8220;src&#8221; folder<\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"267\" height=\"211\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/10b-_files_sind_da.png\" alt=\"Links to imported libraries\" class=\"wp-image-8116\"\/><figcaption>Here you see only the links in the folder &#8220;src&#8221;<\/figcaption><\/figure><\/div>\n<p>The next important measure is to replace the &#8220;&lt; &gt;  &#8221; brackets behind the #include command for this library with quotation marks in the program code. <\/p>\r\n<p>If the header (&#8220;.h&#8221;) file is physically in the &#8220;src&#8221; folder, it is found by its name. If only the link has been imported, then you have to specify the path to the directory where it is actually located. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/11-Anfuehrungszeichen.png\"><img loading=\"lazy\" decoding=\"async\" width=\"571\" height=\"85\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/11-Anfuehrungszeichen.png\" alt=\"\" class=\"wp-image-8117\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/11-Anfuehrungszeichen.png 571w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/11-Anfuehrungszeichen-300x45.png 300w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/a><figcaption>For libraries that are located in the &#8220;src&#8221; folder<\/figcaption><\/figure>\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9a-Alternative_Add_h_und_cpp.png\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"93\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9a-Alternative_Add_h_und_cpp.png\" alt=\"\" class=\"wp-image-8118\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9a-Alternative_Add_h_und_cpp.png 728w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/9a-Alternative_Add_h_und_cpp-300x38.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a><figcaption>For libraries that only have links in the src folder<\/figcaption><\/figure><p>Now go again to &#8220;Build Solution&#8221; and &#8211; behold &#8211; there is no more error message.&nbsp;<\/p>\r\n\n<h2 class=\"wp-block-heading\">Using debugging for the Arduino<\/h2>\n<p>Now you can reap the fruits of your work and use debugging for the Arduino, e.g. run the program step by step, set breakpoints, track variable and register contents, etc. Here I just want to show you how to switch to debugWire mode and set breakpoints. For the other options, look at my <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/atmel-studio-7-an-introduction?lang=en\" target=\"_blank\" rel=\"noopener noreferrer\">previous post<\/a>. <\/p>\r\n<p>Breakpoints, i.e. points where the program stops, are simply set by clicking on the gray bar next to the program code. They appear as a red dot. Clicking on a breakpoint again deletes it. By the way, the program stops <em>before<\/em> the selected line is executed. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/14-breakpoints.png\"><img loading=\"lazy\" decoding=\"async\" width=\"546\" height=\"298\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/14-breakpoints.png\" alt=\"Debugging for the Arduino with breakpoints\" class=\"wp-image-8120\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/14-breakpoints.png 546w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/14-breakpoints-300x164.png 300w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/a><\/figure><p>Go to Tools (the hammer icon) in the toolbar. Then choose your programmer and &#8220;debugWIRE&#8221; as interface.<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/13-Tools_Dragon_DebugWire.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"524\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/13-Tools_Dragon_DebugWire-1024x524.png\" alt=\"Select programmer and debugWIRE to enable debugging for the Arduino&#13;&#10;\" class=\"wp-image-8121\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/13-Tools_Dragon_DebugWire-1024x524.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/13-Tools_Dragon_DebugWire-300x153.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/13-Tools_Dragon_DebugWire-768x393.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/13-Tools_Dragon_DebugWire.png 1083w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>Click on &#8220;Start Debugging and Break&#8221; (the play-pause icon):<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/15a-Start_Debugging_and_Break.png\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"146\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/15a-Start_Debugging_and_Break.png\" alt=\"\" class=\"wp-image-8122\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/15a-Start_Debugging_and_Break.png 755w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/15a-Start_Debugging_and_Break-300x58.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/a><\/figure><p>Close the following error message with &#8220;Yes&#8221;. <\/p>\r\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Failed_to_launch.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Failed_to_launch.png\" alt=\"Error message: debugWIRE requires activated DWEN fuse\" class=\"wp-image-8123\" width=\"537\" height=\"174\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Failed_to_launch.png 537w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/Failed_to_launch-300x97.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/a><\/figure><\/div>\n<p>Follow the next instruction and disconnect the programmer from the Arduino, briefly interrupt the power supply from the Arduino and reconnect the programmer. I always save myself steps 1 and 3 and have never had any problems &#8211; up to you. Then click OK.<\/p>\r\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/15c_debugWire_enabled_1234.png\"><img loading=\"lazy\" decoding=\"async\" width=\"470\" height=\"204\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/15c_debugWire_enabled_1234.png\" alt=\"Message from Atmel Studio: Procedure to enable debugWIRE\" class=\"wp-image-8124\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/15c_debugWire_enabled_1234.png 470w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/15c_debugWire_enabled_1234-300x130.png 300w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/a><\/figure><\/div>\n<p>The program starts and will then stop immediately.<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/16_bleibt_stehen.png\"><img loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"536\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/16_bleibt_stehen.png\" alt=\"First program stop during debugging \" class=\"wp-image-8125\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/16_bleibt_stehen.png 824w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/16_bleibt_stehen-300x195.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/16_bleibt_stehen-768x500.png 768w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/a><\/figure><p>Now go to &#8220;Continue&#8221;&#8230;<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/17-Continue.png\"><img loading=\"lazy\" decoding=\"async\" width=\"899\" height=\"116\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/17-Continue.png\" alt=\"Continue debugging\" class=\"wp-image-8126\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/17-Continue.png 899w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/17-Continue-300x39.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/17-Continue-768x99.png 768w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><\/a><\/figure><p>&#8230; the program continues until the first breakpoint. With each additional &#8220;Continue&#8221; you go to the next breakpoint. In combination with tracking variable values, you have a very efficient tool for finding errors. Especially with larger sketches, the error detection can take longer than the programming work itself. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/18-stop_bei_breakpoint.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/18-stop_bei_breakpoint-1024x662.png\" alt=\"Debugging for the Arduino in action - stop at the breakpoints\" class=\"wp-image-8127\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/18-stop_bei_breakpoint-1024x662.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/18-stop_bei_breakpoint-300x194.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/18-stop_bei_breakpoint-768x496.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/18-stop_bei_breakpoint.png 1094w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<h2 class=\"wp-block-heading\">Undo debugging for the Arduino <\/h2>\n<p>In order to be able to upload sketches to the Arduino UNO again with the Arduino IDE, further settings in the ATmega328P have to be undone <em>before<\/em> restoring the &#8220;RESET EN&#8221; contact on the Arduino board. If you do not do this, you get error messages like this when you try to upload sketches:<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/19_Arduino_per_IDE_geht_nicht_mehr.png\"><img loading=\"lazy\" decoding=\"async\" width=\"821\" height=\"158\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/19_Arduino_per_IDE_geht_nicht_mehr.png\" alt=\"Debugging for the Arduino - unfortunately you have to undo the settings, otherwise you get these error messages \" class=\"wp-image-8128\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/19_Arduino_per_IDE_geht_nicht_mehr.png 821w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/19_Arduino_per_IDE_geht_nicht_mehr-300x58.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/19_Arduino_per_IDE_geht_nicht_mehr-768x148.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/a><\/figure><p>Here&#8217;s the procedure. First, stop debugWIRE mode via <\/p>\r\n<p>Debug  &#8211;&gt; Disable debugWIRE and Close<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20-Disable_DebugWire_and_Close.png\"><img loading=\"lazy\" decoding=\"async\" width=\"771\" height=\"299\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20-Disable_DebugWire_and_Close.png\" alt=\"Exit debugging mode with Disable debugWIRE and Close\" class=\"wp-image-8129\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20-Disable_DebugWire_and_Close.png 771w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20-Disable_DebugWire_and_Close-300x116.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/20-Disable_DebugWire_and_Close-768x298.png 768w\" sizes=\"auto, (max-width: 771px) 100vw, 771px\" \/><\/a><\/figure><p>Then switch to ISP mode in the tool area:<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/21-zurueck_zu_ISP.png\"><img loading=\"lazy\" decoding=\"async\" width=\"809\" height=\"533\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/21-zurueck_zu_ISP.png\" alt=\"Switching to ISP mode\" class=\"wp-image-8130\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/21-zurueck_zu_ISP.png 809w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/21-zurueck_zu_ISP-300x198.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/21-zurueck_zu_ISP-768x506.png 768w\" sizes=\"auto, (max-width: 809px) 100vw, 809px\" \/><\/a><\/figure><p>The next step is &#8220;Device Programming&#8221; (the icon with the IC and lightning). Click on &#8220;Apply&#8221;. By clicking the &#8220;Read&#8221; buttons you can query the signature of the MCU and determine the voltage at the Arduino. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/22-Device-Programming.png\"><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"590\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/22-Device-Programming.png\" alt=\"Switch to the device programming window \" class=\"wp-image-8131\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/22-Device-Programming.png 748w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/22-Device-Programming-300x237.png 300w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/a><\/figure><p>Then select &#8220;Fuses&#8221; and enter the fuse register values for EXTENDED, HIGH and LOW, which are marked below. Now click on &#8220;Program&#8221;. If all goes well, you get a message &#8220;Verify Registers&#8230; OK&#8221;. <\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/23-Fuses_einstellen.png\"><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"593\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/23-Fuses_einstellen.png\" alt=\"Change of fuse register addresses\" class=\"wp-image-8132\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/23-Fuses_einstellen.png 748w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/23-Fuses_einstellen-300x238.png 300w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/a><\/figure><p>Now the Arduino bootloader has to be burned to the ATmega328P. Go to &#8220;&#8230;&#8221; (marked in red).&nbsp;<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/24-Memories.png\"><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"594\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/24-Memories.png\" alt=\"Bringing back the Arduino bootloader\" class=\"wp-image-8133\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/24-Memories.png 744w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/24-Memories-300x240.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/a><\/figure><p>The correct boot loader is &#8220;optiboot_atmega328.hex&#8221;. You can find it, starting from the Arduino installation path, in hardware\\Arduino\\avr\\bootloaders\\optiboot<\/p>\r\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/25-Bootloader_waehlen.png\"><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"594\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/25-Bootloader_waehlen.png\" alt=\"optiboot_atmega328 choose\" class=\"wp-image-8134\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/25-Bootloader_waehlen.png 945w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/25-Bootloader_waehlen-300x189.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/25-Bootloader_waehlen-768x483.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/25-Bootloader_waehlen-542x340.png 542w\" sizes=\"auto, (max-width: 945px) 100vw, 945px\" \/><\/a><\/figure><p>Now click on &#8220;Program&#8221;. Then restore the &#8220;RESET _EN&#8221; connection on the Arduino board. But let&#8217;s face it, all too often you don&#8217;t want to change back and forth. Personally, I would rather spend a few euros on a second Arduino. <\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Step-by-step guide to debugging the Arduino UNO using Atmel Studio and a suitable programmer. The integration of libraries is explained.<\/p>\n","protected":false},"author":1,"featured_media":8136,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[575],"tags":[556,759,762,769,770,772,773],"class_list":["post-9341","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-and-tools","tag-arduino-en-2","tag-atmel-studio-7-en-2","tag-debugging-en","tag-debugging-for-the-arduino","tag-embed-libraries","tag-programming-arduino-uno-with-atmel-studio","tag-reset-en-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Debugging for the Arduino UNO with Atmel Studio &#8226; Wolles Elektronikkiste<\/title>\n<meta name=\"description\" content=\"Step-by-step guide to debugging the Arduino UNO using Atmel Studio and a suitable programmer. The integration of libraries is explained.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debugging for the Arduino UNO with Atmel Studio &#8226; Wolles Elektronikkiste\" \/>\n<meta property=\"og:description\" content=\"Step-by-step guide to debugging the Arduino UNO using Atmel Studio and a suitable programmer. The integration of libraries is explained.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio\" \/>\n<meta property=\"og:site_name\" content=\"Wolles Elektronikkiste\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-01T11:07:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-29T12:14:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/arduino-bugs.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1126\" \/>\n\t<meta property=\"og:image:height\" content=\"1081\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Wolfgang Ewald\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wolfgang Ewald\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio\"},\"author\":{\"name\":\"Wolfgang Ewald\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"headline\":\"Debugging for the Arduino UNO with Atmel Studio\",\"datePublished\":\"2020-11-01T11:07:34+00:00\",\"dateModified\":\"2020-11-29T12:14:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio\"},\"wordCount\":1885,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/arduino-bugs.png\",\"keywords\":[\"Arduino\",\"Atmel Studio 7\",\"debugging\",\"Debugging for the Arduino\",\"Embed libraries\",\"Programming Arduino UNO with Atmel Studio\",\"Reset En\"],\"articleSection\":[\"Software and tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio\",\"name\":\"Debugging for the Arduino UNO with Atmel Studio &#8226; Wolles Elektronikkiste\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/arduino-bugs.png\",\"datePublished\":\"2020-11-01T11:07:34+00:00\",\"dateModified\":\"2020-11-29T12:14:59+00:00\",\"description\":\"Step-by-step guide to debugging the Arduino UNO using Atmel Studio and a suitable programmer. The integration of libraries is explained.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio#primaryimage\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/arduino-bugs.png\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/arduino-bugs.png\",\"width\":1126,\"height\":1081},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/debugging-for-the-arduino-uno-with-atmel-studio#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Debugging for the Arduino UNO with Atmel Studio\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\",\"name\":\"Wolles Elektronikkiste\",\"description\":\"Die wunderbare Welt der Elektronik\",\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\",\"name\":\"Wolfgang Ewald\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"width\":512,\"height\":512,\"caption\":\"Wolfgang Ewald\"},\"logo\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Debugging for the Arduino UNO with Atmel Studio &#8226; Wolles Elektronikkiste","description":"Step-by-step guide to debugging the Arduino UNO using Atmel Studio and a suitable programmer. The integration of libraries is explained.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio","og_locale":"en_US","og_type":"article","og_title":"Debugging for the Arduino UNO with Atmel Studio &#8226; Wolles Elektronikkiste","og_description":"Step-by-step guide to debugging the Arduino UNO using Atmel Studio and a suitable programmer. The integration of libraries is explained.","og_url":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio","og_site_name":"Wolles Elektronikkiste","article_published_time":"2020-11-01T11:07:34+00:00","article_modified_time":"2020-11-29T12:14:59+00:00","og_image":[{"width":1126,"height":1081,"url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/arduino-bugs.png","type":"image\/png"}],"author":"Wolfgang Ewald","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Wolfgang Ewald","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio#article","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio"},"author":{"name":"Wolfgang Ewald","@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"headline":"Debugging for the Arduino UNO with Atmel Studio","datePublished":"2020-11-01T11:07:34+00:00","dateModified":"2020-11-29T12:14:59+00:00","mainEntityOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio"},"wordCount":1885,"commentCount":0,"publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/arduino-bugs.png","keywords":["Arduino","Atmel Studio 7","debugging","Debugging for the Arduino","Embed libraries","Programming Arduino UNO with Atmel Studio","Reset En"],"articleSection":["Software and tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio","url":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio","name":"Debugging for the Arduino UNO with Atmel Studio &#8226; Wolles Elektronikkiste","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#website"},"primaryImageOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio#primaryimage"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/arduino-bugs.png","datePublished":"2020-11-01T11:07:34+00:00","dateModified":"2020-11-29T12:14:59+00:00","description":"Step-by-step guide to debugging the Arduino UNO using Atmel Studio and a suitable programmer. The integration of libraries is explained.","breadcrumb":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio#primaryimage","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/arduino-bugs.png","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/07\/arduino-bugs.png","width":1126,"height":1081},{"@type":"BreadcrumbList","@id":"https:\/\/wolles-elektronikkiste.de\/en\/debugging-for-the-arduino-uno-with-atmel-studio#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/wolles-elektronikkiste.de\/en"},{"@type":"ListItem","position":2,"name":"Debugging for the Arduino UNO with Atmel Studio"}]},{"@type":"WebSite","@id":"https:\/\/wolles-elektronikkiste.de\/en#website","url":"https:\/\/wolles-elektronikkiste.de\/en","name":"Wolles Elektronikkiste","description":"Die wunderbare Welt der Elektronik","publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wolles-elektronikkiste.de\/en?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46","name":"Wolfgang Ewald","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","width":512,"height":512,"caption":"Wolfgang Ewald"},"logo":{"@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png"}}]}},"_links":{"self":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/9341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/comments?post=9341"}],"version-history":[{"count":0,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/9341\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media\/8136"}],"wp:attachment":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media?parent=9341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/categories?post=9341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/tags?post=9341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}