﻿{"id":266,"date":"2014-06-01T00:48:38","date_gmt":"2014-05-31T21:48:38","guid":{"rendered":"http:\/\/allchina.a-lisa.org\/?p=266"},"modified":"2014-06-01T00:48:38","modified_gmt":"2014-05-31T21:48:38","slug":"%d0%bf%d0%be%d0%b4%d0%ba%d0%bb%d1%8e%d1%87%d0%b5%d0%bd%d0%b8%d0%b5-avrdragon-%d0%ba-%d1%81%d1%80%d0%b5%d0%b4%d0%b5-%d1%80%d0%b0%d0%b7%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%ba%d0%b8-arduino","status":"publish","type":"post","link":"https:\/\/allchina.a-lisa.org\/?p=266","title":{"rendered":"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 AVRDRAGON \u043a \u0441\u0440\u0435\u0434\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 ARDUINO"},"content":{"rendered":"<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u00a0http:\/\/forum.arduino.cc\/index.php?topic=51561.0<\/p>\n<p>I read on this forum a few confused posts about using AVR Dragon as an external programmer with Arduino IDE and thought my experience may be useful to someone.<\/p>\n<p>AVR Dragon can be used as an external programmer with Arduino IDE, e.g. to burn sketches to Arduino-compatible hardware without the bootloader. For example, I use it to upload my sketch to an ATMega8L controlling an audio amplifier based on TI&#8217;s TAS5086 PWM processor. I use it under Mac OS X; I have heard, but not tested, that the same thing under Windows may be tricky because of USB driver incompatibility.<br \/>\n<!--more--><br \/>\nAs expained in <a href=\"http:\/\/www.arduino.cc\/en\/Hacking\/Programmer\" target=\"_blank\" rel=\"nofollow\">http:\/\/www.arduino.cc\/en\/Hacking\/Programmer<\/a>, I add the following three lines to the programmers.txt:<\/p>\n<p>dragon.name=Atmel AVR Dragon in ISP mode<br \/>\ndragon.communication=usb<br \/>\ndragon.protocol=dragon_isp<\/p>\n<p>(after that, AVR Dragon appears in the list of programmers in the &#171;Tools -&gt; Burn Bootloader&#187; menu), and either change the line<\/p>\n<p>upload.using=bootloader<\/p>\n<p>in the preferences.txt (which must be edited when the IDE is not running, or it will be overwritten) to<\/p>\n<p>upload.using=dragon<\/p>\n<p>to have Arduino IDE use AVR Dragon for all uploads, or add the line<\/p>\n<p>atmega328.upload.using=dragon<\/p>\n<p>to the appropriate section of boards.txt to use AVR Dragon only if &#171;Arduino Duemilanove or Nano w\/ ATmega32&#187; is selected.<\/p>\n<p>Either way, when I connect my Arduino Duemilanove to the AVR Dragon with an ISP cable, Arduino IDE uploads sketches flawlessly.<\/p>\n<p>For some reason, I cannot burn the bootloader in the same way. avrdude sucessfully writes unlock bits with the following command:<\/p>\n<p>\/Applications\/Arduino.app\/Contents\/Resources\/Java\/hardware\/tools\/avr\/bin\/avrdude -C\/Applications\/Arduino.app\/Contents\/Resources\/Java\/hardware\/tools\/avr\/etc\/avrdude.conf -v -v -v -v -patmega328p -cdragon_isp -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m<\/p>\n<p>but the attempt to actually burn the bootloader fails:<\/p>\n<p>\/Applications\/Arduino.app\/Contents\/Resources\/Java\/hardware\/tools\/avr\/bin\/avrdude -C\/Applications\/Arduino.app\/Contents\/Resources\/Java\/hardware\/tools\/avr\/etc\/avrdude.conf -v -v -v -v -patmega328p -cdragon_isp -Pusb -Uflash:w:\/Applications\/Arduino.app\/Contents\/Resources\/Java\/hardware\/arduino\/bootloaders\/atmega\/ATmegaBOOT_168_atmega328.hex:i -Ulock:w:0x0F:m<\/p>\n<p>avrdude: Version 5.4-arduino, compiled on Oct\u00a0 9 2007 at 11:20:31<br \/>\nCopyright (c) 2000-2005 Brian Dean, <a href=\"http:\/\/www.bdmicro.com\/\" target=\"_blank\" rel=\"nofollow\">http:\/\/www.bdmicro.com\/<\/a><\/p>\n<p>System wide configuration file is &#171;\/Applications\/Arduino.app\/Contents\/Resources\/Java\/hardware\/tools\/avr\/etc\/avrdude.conf&#187;<br \/>\nUser configuration file is &#171;\/Users\/*******\/.avrduderc&#187;<br \/>\nUser configuration file does not exist or is not a regular file, skipping<\/p>\n<p>Using Port\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 : usb<br \/>\nUsing Programmer\u00a0 \u00a0 \u00a0 : dragon_isp<br \/>\navrdude: stk500v2_dragon_isp_open()<br \/>\navrdude: usbdev_open(): did not find any USB device &#171;usb&#187;<\/p>\n<p>If I copy-paste that last command into the terminal, it works just fine. I&#8217;d be grateful is someone let me know how to make it work from within the IDE.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u00a0http:\/\/forum.arduino.cc\/index.php?topic=51561.0 I read on this forum a few confused posts about using AVR Dragon as an external programmer with<\/p>\n","protected":false},"author":2,"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":[98,97],"tags":[],"class_list":["post-266","post","type-post","status-publish","format-standard","hentry","category-arduino","category-avr"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7OYvE-4i","_links":{"self":[{"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=\/wp\/v2\/posts\/266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=266"}],"version-history":[{"count":1,"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions"}],"predecessor-version":[{"id":267,"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions\/267"}],"wp:attachment":[{"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/allchina.a-lisa.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}