{"id":1473,"date":"2012-11-02T00:39:28","date_gmt":"2012-11-02T03:39:28","guid":{"rendered":"http:\/\/wordpress.matbra.com\/?p=1473"},"modified":"2012-11-02T00:39:28","modified_gmt":"2012-11-02T03:39:28","slug":"programando-atmega8u2-no-arduino-uno-utilizando-usb-asp","status":"publish","type":"post","link":"https:\/\/wordpress.matbra.com\/en\/2012\/11\/02\/programando-atmega8u2-no-arduino-uno-utilizando-usb-asp\/","title":{"rendered":"Programming atmega8u2 on Arduino Uno using USB Asp"},"content":{"rendered":"<p>Hello,<\/p>\n<p>Recently my Arduino UNO stopped to be recognized by computer (using USB), I tried a few stuffs: <\/p>\n<p>&#8211; Changed the Atmega328<br \/>\n&#8211; Rewrite bootloader<br \/>\n&#8211; Tested the controller on other board<br \/>\n&#8211; Measure the connection between a few pins using a multimeter<\/p>\n<p>Nothing worked, so I decided to try to update the atmega8u2 firmware that is responsible to control de USB connection, I found two articles that I used as base:<br \/>\n<a href=\"http:\/\/arduino.cc\/en\/Hacking\/DFUProgramming8U2\" target=\"_blank\">Updating the Atmega8U2 on an Uno or Mega2560 using DFU <\/a> e tamb\u00e9m <a href=\"http:\/\/marcoramilli.blogspot.com.br\/2011\/05\/how-to-upgrade-atmega8u2-firmware.html\" target=\"_blank\">How to upgrade atmega8u2 firmware<\/a> <\/p>\n<p>Both of them used solutions that needs to soldering a resistor on the board, but I don&#8217;t want to solder anything to the board, so I checked next to the atmega8u2 exists the ICSP pins, so I decided to try to burn the bootloader using them. Just to prevent other disaster I removed my atmega328 from board and connected the USB ASP to the ICSP pins. (Remember that the PIN 1 has a number or a little mark near it, mine had a small white circle)<\/p>\n<p><a href=\"http:\/\/wordpress.matbra.com\/wp-content\/uploads\/avr_icsp.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/wordpress.matbra.com\/wp-content\/uploads\/avr_icsp-300x132.png\" alt=\"\" title=\"AVR ICSP\" width=\"300\" height=\"132\" class=\"aligncenter size-medium wp-image-1474\" srcset=\"https:\/\/wordpress.matbra.com\/wp-content\/uploads\/avr_icsp-300x132.png 300w, https:\/\/wordpress.matbra.com\/wp-content\/uploads\/avr_icsp.png 550w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>After that, I accessed the dir that contains atmega8u2 hex of Arduino Uno (\/arduino\/hardware\/arduino\/firmware), and then I tried to rewrite the bootloader:<\/p>\n<blockquote><p>sudo avrdude -c usbasp -p m8 -u -U flash:w:UNO-dfu_and_usbserial_combined.hex<\/p><\/blockquote>\n<p>It didn&#8217;t worked because it is a atmega8u2 and I was trying to write it with atmega8 the error was:<\/p>\n<blockquote><p>avrdude: Yikes!  Invalid device signature. <\/p><\/blockquote>\n<p>So I did a little more research and I discover that at90usb162 is almost the same, so I decided to take a shot with force (-F) option<\/p>\n<blockquote><p>sudo avrdude -c usbasp -p usb162 -u -U flash:w:UNO-dfu_and_usbserial_combined.hex  -F<\/p><\/blockquote>\n<p>I waited it to burn, turn arduino uno off, connected my atmega328 and then turn it on and my USB just showed up on my computer, so now I can program my Arduino UNO using USB again.<\/p>\n<p>Matheus<\/p>\n<p>PS: Right after the booloader update I tried to Upload a Sketch to atmega328 without sucess, it was out of sync, so I tried to rewrite the bootloader of atmega328, and then everything started to work.<\/p>\n<p>References:<br \/>\n<a href=\"http:\/\/8515.avrfreaks.net\/index.php?name=PNphpBB2&#038;file=viewtopic&#038;p=688637 \" target=\"_blank\">http:\/\/8515.avrfreaks.net\/index.php?name=PNphpBB2&#038;file=viewtopic&#038;p=688637<br \/>\n<\/a><a href=\"http:\/\/image.pinout.net\/pinout_10_pin_files\/connector_pinout.php?image=avr_icsp.png&#038;pinout=%20This%20a%20pinout%20of%20the%20AVR%20ICSP%20header.%20(6-pin%20&#038;%2010-pin) \" target=\"_blank\">http:\/\/image.pinout.net\/pinout_10_pin_files\/connector_pinout.php?image=avr_icsp.png&#038;pinout=%20This%20a%20pinout%20of%20the%20AVR%20ICSP%20header.%20(6-pin%20&#038;%2010-pin)<br \/>\n<\/a><\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Hello, Recently my Arduino UNO stopped to be recognized by computer (using USB), I tried a few stuffs: &#8211; Changed the Atmega328 &#8211; Rewrite bootloader&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/wordpress.matbra.com\/en\/2012\/11\/02\/programando-atmega8u2-no-arduino-uno-utilizando-usb-asp\/\">Continue reading<span class=\"screen-reader-text\">Programming atmega8u2 on Arduino Uno using USB Asp<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_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}},"categories":[214],"tags":[215,292,294,293,295,277,290],"class_list":["post-1473","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-arduino-2","tag-atmega328","tag-atmega8u2","tag-avrdude","tag-bootloader","tag-uno","tag-usbasp","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/psjGE-nL","_links":{"self":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/1473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/comments?post=1473"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/1473\/revisions"}],"predecessor-version":[{"id":1475,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/1473\/revisions\/1475"}],"wp:attachment":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/media?parent=1473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/categories?post=1473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/tags?post=1473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}