{"id":1377,"date":"2009-03-23T14:18:56","date_gmt":"2009-03-23T19:18:56","guid":{"rendered":"http:\/\/nuxx.net\/blog\/?p=1377"},"modified":"2009-03-23T23:32:35","modified_gmt":"2009-03-24T04:32:35","slug":"programming-problem-w-avr-dragon-and-atmega8-in-hvpp-mode","status":"publish","type":"post","link":"https:\/\/nuxx.net\/blog\/2009\/03\/23\/programming-problem-w-avr-dragon-and-atmega8-in-hvpp-mode\/","title":{"rendered":"Programming Problem w\/ AVR Dragon and ATmega8 in HVPP Mode"},"content":{"rendered":"<p>Over the weekend I received the jumpers for connecting the <a href=\"https:\/\/nuxx.net\/blog\/2009\/03\/13\/avr-dragon\/\">recently acquired AVR Dragon<\/a>, so I decided to give it a go this weekend. Because the chips I&#8217;m using are programmed to use an external clock, the best programming mode for writing chips stand-alone is High-Voltage Parallel Programming, which doesn&#8217;t rely on an external clock.<\/p>\n<p>After jumpering the board for HVPP per the SCKT3200A2 devicesheet in the <a href=\"http:\/\/support.atmel.no\/knowledgebase\/avrstudiohelp\/mergedProjects\/AVRDragon\/AVRDragon.htm\">official AVR Dragon documentation<\/a> I tried it out on both OS X and XP, and it mostly works well, except for programming the EEPROM. For some reason, EEPROM seems to just not write, and thus validation fails. If I insert a chip with EPROM already programmed properly, validation will work, so reading is definitely working and nothing is (even partially) overwriting the existing data.<\/p>\n<p>There are no problems writing the Flash or fuses, and since writing to both Flash and EEPROM use the same lines, I don&#8217;t think it&#8217;s something mis-jumpered. Nor do I believe the problem is the chip itself, since I&#8217;ve tried multiple chips which can be programmed in an STK200 (parallel port bitbang) programmer.<\/p>\n<p>Here&#8217;s the command lines used with the AVR Dragon which errors while validating the EEPROM:<\/p>\n<blockquote><p><tt>avrdude -p m8 -P usb -c dragon_pp -U lfuse:w:0x3f:m -U hfuse:w:0xdf:m -U flash:w:SDrive.hex:i -U eeprom:w:SDrive.eep:i<\/tt><\/p><\/blockquote>\n<p>Here&#8217;s the one used with the STK200 clone, the same chip, and the same version of <tt>avrdude<\/tt>, which works just fine:<\/p>\n<blockquote><p><tt>avrdude -p m8 -c stk200 -U lfuse:w:0x3f:m -U hfuse:w:0xdf:m -U flash:w:SDrive.hex:i -U eeprom:w:SDrive.eep:i<\/tt><\/p><\/blockquote>\n<p>Here&#8217;s the actual error:<\/p>\n<blockquote><p><tt>[Working stuff here cut...]<br \/>\navrdude: verifying ...<br \/>\navrdude: 8084 bytes of flash verified<br \/>\navrdude: reading input file \"SDrive.eep\"<br \/>\navrdude: writing eeprom (329 bytes):<\/p>\n<p>Writing | ################################################## | 100% 36.51s<\/p>\n<p>avrdude: 329 bytes of eeprom written<br \/>\navrdude: verifying eeprom memory against SDrive.eep:<br \/>\navrdude: load data eeprom data from input file SDrive.eep:<br \/>\navrdude: input file SDrive.eep contains 329 bytes<br \/>\navrdude: reading on-chip eeprom data:<\/p>\n<p>Reading | ################################################## | 100% 33.60s<\/p>\n<p>avrdude: verifying ...<br \/>\navrdude: verification error, first mismatch at byte 0x0000<br \/>\n         0x72 != 0xff<br \/>\navrdude: verification error; content mismatch<\/p>\n<p>avrdude: safemode: Fuses OK<\/p>\n<p>avrdude done.  Thank you.<\/tt><\/p><\/blockquote>\n<p>If anyone has an idea as to what might be wrong here, I&#8217;d love to hear it. This is exactly the same problem I get on both Windows XP (<tt>avrdude<\/tt> v5.6 from WinAVR-20081205) and OS X (<tt>avrdude<\/tt> v5.5 from AVRMacPack).<\/p>\n<p>For what it&#8217;s worth, I have <a href=\"http:\/\/www.avrfreaks.net\/index.php?name=PNphpBB2&#038;file=viewtopic&#038;t=76574\">posted this here on the AVR Freaks forum<\/a>, but it doesn&#8217;t seem to be receiving any replies.<\/p>\n<p><strong>UPDATE:<\/strong> It seems that this is a problem with <tt>avrdude<\/tt>. I can program the chip with no problem in HVPP mode using <a href=\"http:\/\/www.atmel.com\/dyn\/Products\/tools_card.asp?tool_id=2725\">AVR Studio<\/a>. This would be a good time to have a logic analyzer. Maybe I could actually fix the problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the weekend I received the jumpers for connecting the recently acquired AVR Dragon, so I decided to give it a go this weekend. Because&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/nuxx.net\/blog\/2009\/03\/23\/programming-problem-w-avr-dragon-and-atmega8-in-hvpp-mode\/\">Continue reading<span class=\"screen-reader-text\">Programming Problem w\/ AVR Dragon and ATmega8 in HVPP Mode<\/span><\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,11],"tags":[],"class_list":["post-1377","post","type-post","status-publish","format-standard","hentry","category-electronics","category-making-things","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/1377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/comments?post=1377"}],"version-history":[{"count":7,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/1377\/revisions"}],"predecessor-version":[{"id":1384,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/1377\/revisions\/1384"}],"wp:attachment":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/media?parent=1377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/categories?post=1377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/tags?post=1377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}