{"id":389,"date":"2019-04-04T17:21:30","date_gmt":"2019-04-04T17:21:30","guid":{"rendered":"https:\/\/arduino-developer.com\/arduino\/?p=389"},"modified":"2021-01-05T11:51:24","modified_gmt":"2021-01-05T11:51:24","slug":"attiny-programming","status":"publish","type":"post","link":"https:\/\/arduino-developer.com\/arduino\/hardware\/arduinos\/attiny-programming","title":{"rendered":"ATtiny &#8211; Programming"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Bootloader vs Programmer<\/h4>\n\n\n\n<p>The ICSP programmer is needed when writing the bootloader or if you want to save program flash space and only program your ATtiny using the ICSP. <\/p>\n\n\n\n<p>When programming the ATTiny using the bootloader you use the TX\/RX serial port (the ATTiny should be connected to your USB-serial adapter).  The ICSP programmer doesn&#8217;t need to be connected.<\/p>\n\n\n\n<p>Using the &#8220;Upload using Programmer&#8221; option (SHIFT+Upload), instead of the normal serial port Upload wipes out the bootloader.  However it doesn&#8217;t wipe out the config fuse settings as it seems these are only set when using &#8220;Burn Bootloader&#8221;.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Using Crystal<\/h4>\n\n\n\n<p>Note that when programming from the ArduinoIDE the fuse bits are not set by SHIFT+Upload button.  To program them select Menu &gt; Tools &gt; Burn Bootloader<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Adding ATtiny IC&#8217;s to Arduino IDE<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">ATTinyCore &#8211; ATtiny441\/841\/1634 + most other ATtiny&#8217;s<\/h5>\n\n\n\n<p><a href=\"https:\/\/github.com\/SpenceKonde\/ATTinyCore\">https:\/\/github.com\/SpenceKonde\/ATTinyCore<\/a><\/p>\n\n\n\n<p>Menu > File > Preferences > Additional Boards Manager URLs > Paste the following URL into the field (use a comma to separate it from any URLs you\u2019ve already added):<br>   http:\/\/drazzy.com\/package_drazzy.com_index.json<\/p>\n\n\n\n<p>Menu &gt; Tools &gt; Board &gt; Boards Manager&#8230;<br>Find &#8220;ATTinyCore by Spence Konde&#8221;  and install it.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">ATtiny24\/44\/84\/25\/45\/85 (Spence Konde one above also has these ATtiny&#8217;s)<\/h5>\n\n\n\n<p><a href=\"https:\/\/github.com\/damellis\/attiny\">https:\/\/github.com\/damellis\/attiny<\/a><\/p>\n\n\n\n<p>Menu &gt; File &gt; Preferences &gt; Additional Boards Manager URLs &gt; Paste the following URL into the field (use a comma to separate it from any URLs you\u2019ve already added):<br>   https:\/\/raw.githubusercontent.com\/damellis\/attiny\/ide-1.6.x-boards-manager\/package_damellis_attiny_index.json<\/p>\n\n\n\n<p>Menu &gt; Tools &gt; Board &gt; Boards Manager&#8230;<br>Find &#8220;attiny by David A. Mellis&#8221; and install it<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"mce_2\">Programming Using Arduino IDE<\/h4>\n\n\n\n<p>Menu &gt; Tools &gt;  Board:  ATtiny##<br>Menu &gt; Tools &gt;  Processor: Select the processor<br>Menu &gt; Tools &gt;  Clock: Select the clock you want to use<br>Menu &gt; Tools &gt; Programmer: USBasp (ATTinyCore) or USBTinyISP<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">First time programming<\/h5>\n\n\n\n<p>Use &#8220;Burn Bootloader&#8221; to burn the config fuses (even if you won&#8217;t use the bootloader afterwards and will overwrite it by programming using the programmer<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Programming use programmer (Not via serial port)<\/h5>\n\n\n\n<p>Then to program your Arduino with your current sketch click the upload button as normal, <strong>but whilst doing so hold down the shift key.<\/strong> This causes it to use the programmer (you can hover over the button with the shift key held and it will confirm &#8216;Upload using programmer&#8217;).<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Burning the bootloader<\/h5>\n\n\n\n<p>Note that when uploading sketches using the programmer only the sketch will be uploaded, not the bootloader. If at any point you need to reprogram the bootloader back into your Arduino then use Tools-&gt;burn bootloader making sure you have the correct board type set.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Programmers from Arduino IDE<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"mce_5\">USBtinyISP<\/h5>\n\n\n\n<p>On windows you need a driver, Adafruit has a &#8220;Windows USBtinyISP signed driver&#8221;: <a href=\"https:\/\/learn.adafruit.com\/usbtinyisp\/download\">https:\/\/learn.adafruit.com\/usbtinyisp\/download<\/a><\/p>\n\n\n\n<p>You don&#8217;t need to run the exe, instead plug in the programmer, Windows will fail to install drivers for it.  Then in Windows Device Manger find USBtiny in &#8220;Other devices&#8221;, select &#8220;Update driver&#8221;, browse to the unzipped driver folder and let windows install it.  Once installed correctly the USBtiny will move to folder &#8220;Atmel USB Devices&#8221; in Device Manager<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Connecting USBtinyISP to the ATtiny<\/h5>\n\n\n<pre><span style=\"text-decoration: underline;\">USBtinyISP<\/span>   <span style=\"text-decoration: underline;\">Function<\/span>   <span style=\"text-decoration: underline;\">ATtiny84<\/span><br>    1        MISO       8<br>    2        VCC        1<br>    3        SCK        9<br>    4        MOSI       7<br>    5        Reset      4<br>    6        GND        14<\/pre>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bootloader vs Programmer The ICSP programmer is needed when writing the bootloader or if you want to save program flash space and only program your ATtiny using the ICSP. When programming the ATTiny using the bootloader you use the TX\/RX serial port (the ATTiny should be connected to your USB-serial adapter). The ICSP programmer doesn&#8217;t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,41],"tags":[],"class_list":["post-389","post","type-post","status-publish","format-standard","hentry","category-arduinos","category-programmers"],"_links":{"self":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/comments?post=389"}],"version-history":[{"count":23,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":632,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/389\/revisions\/632"}],"wp:attachment":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/media?parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/categories?post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/tags?post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}