{"id":540,"date":"2017-04-14T01:25:47","date_gmt":"2017-04-14T00:25:47","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=540"},"modified":"2021-07-13T17:16:11","modified_gmt":"2021-07-13T16:16:11","slug":"burning-arduino-bootloader-to-atmega8-or-other-atmega","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/burning-arduino-bootloader-to-atmega8-or-other-atmega\/","title":{"rendered":"Burning Arduino Bootloader to Atmega8 or other Atmega"},"content":{"rendered":"<p>This is for all who are having problems in burning the Arduino Bootloader on an Atmega8 or any other Atmega Processor using a Arduino Board like Arduino Uno.<\/p>\n<ol>\n<li>\n<pre class='wp-code-highlight prettyprint'><span style=\"color: #333333;\">The processor for the <strong>first time burning<\/strong> will have to be used with an <strong>external oscillator<\/strong>. I was trying without the external oscillator (was depending on the internal oscillator -  setup the fuses also properly) and was banging my head. <\/span><\/pre>\n<\/li>\n<li>\n<pre class='wp-code-highlight prettyprint'><span style=\"color: #333333;\">The Arduino Uno (or any other board that you are using) will have to be burned with the ArduinoISP code. (<strong>Files -&gt; Examples -&gt; ArduinoISP -&gt; ArduinoISP<\/strong>)<\/span><\/pre>\n<\/li>\n<li>\n<pre class='wp-code-highlight prettyprint'><span style=\"color: #333333;\">Don't bother about the Chip Configurations (and\/or binary) that are available on the net, especially if you are looking to use the external oscillator. None works properly.<strong>Find a board from the existing list that uses the same Processor. <\/strong><\/span><\/pre>\n<\/li>\n<li>\n<pre class='wp-code-highlight prettyprint'><span style=\"color: #333333;\">For <strong>Atmega8<\/strong> use the \"<strong>Arduino NG or older\"<\/strong> from the boards list. <em>That board should also work for Atmega168<\/em><\/span><\/pre>\n<\/li>\n<li>\n<pre class='wp-code-highlight prettyprint'><span style=\"color: #333333;\">If you are using a <strong>8MHZ crystal<\/strong> then open the \"<strong><em>boards.txt<\/em><\/strong>\" files under \"<em>Program Files (x86)\\Arduino\\hardware\\arduino\\avr<\/em>\".\u00a0 And edit the \"<strong>atmegang.build.f_cpu<\/strong>\". Change it to \"8000000L\".<\/span><\/pre>\n<\/li>\n<li>\n<pre class='wp-code-highlight prettyprint'><span style=\"color: #333333;\"><em>If you will be using the Internal Oscillator then you will have to change the fuse values to proper ones in the above board configuration.<\/em><\/span><\/pre>\n<\/li>\n<li>\n<pre class='wp-code-highlight prettyprint'><span style=\"color: #333333;\">I had <strong>problems with high bitrate<\/strong> while burning. So I changed it to \"9600\" (<em>atmegang.upload.speed=9600<\/em>).<\/span><\/pre>\n<\/li>\n<li>\n<pre class='wp-code-highlight prettyprint'>After you are done with the configurations and connections use the option \"<strong>Burn Bootloader<\/strong>\" under Tools in the <strong>Arduino IDE<\/strong><\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>I also found tutorials where it was suggested to remove the processor from board (UNO board) which is being used as programmer. Don&#8217;t do that.<\/p>\n<p>Putting the chip in an UNO board didn&#8217;t work for me. I don&#8217;t know why but it didn&#8217;t.<\/p>\n<p>What I found is the <strong>Atmega8 works best with the external oscillator<\/strong>. With an internal oscillator I was having problems after running the chip continuously for quite some time.<\/p>\n<p>&nbsp;<\/p>\n<pre class='wp-code-highlight prettyprint'><span style=\"color: #333333;\">The <strong>connections with an Arduino UNO<\/strong><\/span>\r\n<span style=\"color: #333333;\">------------------\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --------------------------<\/span>\r\n<span style=\"color: #333333;\">Arduino Uno\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0       Atmega 8 or other<\/span>\r\n<span style=\"color: #333333;\">------------------\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --------------------------<\/span>\r\n<span style=\"color: #333333;\">10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Reset\u00a0 (1 on Atmega8)<\/span>\r\n<span style=\"color: #333333;\">11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MOSI\u00a0\u00a0 (17 on Atmega8)<\/span>\r\n<span style=\"color: #333333;\">12\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MISO\u00a0\u00a0 (18 on Atmega8)<\/span>\r\n<span style=\"color: #333333;\">13\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SCLK\u00a0\u00a0 (19 on Atmega8)<\/span>\r\n<span style=\"color: #333333;\">And the <strong>AVCC<\/strong> <strong>pin<\/strong> should be externally connected to VCC, even if the ADC is not used.<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><em>And like many suggested on the Internet already, a standalone programmer is the best. I got a <strong>USBasp<\/strong> from eBay.<\/em><\/p>\n<p><em>And I guess it is better to invest in a 328p processor due to limited resource of Atmega8 chip. More or less same price.<\/em><\/p>\n<p>Atmega8 IC can be used as standalone IC, that is without using the whole Arduino board. Please see this article for details : <a href=\"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/using-atmega8-or-atmega328p-directly-without-using-arduino-boards\/\">Using Atmega8 or Atmega328p directly without using Arduino boards<\/a> and <a href=\"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/atmega8-to-arduino-pin-mapping\/\">Atmega8 to Arduino pin mapping<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is for all who are having problems in burning the Arduino Bootloader on an Atmega8 or any other Atmega Processor using a Arduino Board like Arduino Uno. The processor for the first time burning will have to be used with an external oscillator. I was trying without the external oscillator (was depending on the&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/burning-arduino-bootloader-to-atmega8-or-other-atmega\/\">Continue reading <span class=\"screen-reader-text\">Burning Arduino Bootloader to Atmega8 or other Atmega<\/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":[10],"tags":[100,101,97,96,86,99,98],"class_list":["post-540","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-ardduino-as-isp","tag-arduino-as-programmer","tag-arduinoisp","tag-atmega-standalone","tag-atmega8","tag-burn-arduino-bootloader","tag-usbasp","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=540"}],"version-history":[{"count":4,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/540\/revisions"}],"predecessor-version":[{"id":903,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/540\/revisions\/903"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}