{"id":2367,"date":"2022-12-19T07:45:03","date_gmt":"2022-12-19T06:45:03","guid":{"rendered":"https:\/\/fotografeer.nl\/?p=2367"},"modified":"2025-10-07T22:14:50","modified_gmt":"2025-10-07T20:14:50","slug":"programming-attiny85-from-arduino-nano-the-challenge","status":"publish","type":"post","link":"https:\/\/fotografeer.nl\/?p=2367","title":{"rendered":"Programming ATtiny85 from Arduino Nano &#8211; The Challenge"},"content":{"rendered":"<style>.kb-table-of-content-nav.kb-table-of-content-id2367_8543c1-6b .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kb-table-of-content-nav.kb-table-of-content-id2367_8543c1-6b .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id2367_8543c1-6b .kb-table-of-contents-title{font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id2367_8543c1-6b .kb-table-of-content-wrap .kb-table-of-content-list{font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}<\/style>\n\n\n<h2 class=\"wp-block-heading\">The Challenge<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In December 2022, this blog post&#8217;s author was given a challenge to implement a way to upload sketches to <a href=\"https:\/\/en.wikipedia.org\/wiki\/AVR_microcontrollers\" target=\"_blank\" rel=\"noreferrer noopener\">ATtiny85<\/a>. There are many <a href=\"https:\/\/create.arduino.cc\/projecthub\/arjun\/programming-attiny85-with-arduino-uno-afb829\" target=\"_blank\" rel=\"noreferrer noopener\">example<\/a>s that use the Uno to program the ATtiny85.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"577\" src=\"https:\/\/fotografeer.nl\/wp-content\/uploads\/2025\/10\/20221222_233231-1024x577.jpg\" alt=\"\" class=\"wp-image-2369\" srcset=\"https:\/\/fotografeer.nl\/wp-content\/uploads\/2025\/10\/20221222_233231-1024x577.jpg 1024w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2025\/10\/20221222_233231-300x169.jpg 300w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2025\/10\/20221222_233231-768x432.jpg 768w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2025\/10\/20221222_233231-1536x865.jpg 1536w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2025\/10\/20221222_233231-2048x1153.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As a self-imposed challenge an <a href=\"https:\/\/en.wikipedia.org\/wiki\/Arduino\" target=\"_blank\" rel=\"noreferrer noopener\">Arduino<\/a> <a href=\"https:\/\/store.arduino.cc\/products\/arduino-nano\" target=\"_blank\" rel=\"noreferrer noopener\">Nano<\/a> would need to be used as the programmer. Being relatively new to the <a href=\"https:\/\/www.arduino.cc\/\" target=\"_blank\" rel=\"noreferrer noopener\">Arduino world<\/a> at that time, research was started to find out the prerequisites to achieve this. This blog post is the first of a series, describing the process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Research<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Searching the Internet several videos and pages were found regarding this topic. Here are some that might peek your interest.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">References<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.arduino.cc\/built-in-examples\/arduino-isp\/ArduinoISP\" target=\"_blank\" rel=\"noreferrer noopener\">Arduino as ISP and Arduino Bootloaders<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=30rPt802n1k\" target=\"_blank\" rel=\"noreferrer noopener\">How-To: Shrinkify Your Arduino Projects<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makezine.com\/article\/technology\/arduino\/how-to-shrinkify-your-arduino-projects-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Matching Article: How-To: Shrinkify Your Arduino Projects<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.instructables.com\/How-to-Program-an-Attiny85-From-an-Arduino-Uno\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Program an Attiny85 From an Arduino Uno<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/solosodium.github.io\/2017-08-07-program-attint85-with-arduino-nano\" target=\"_blank\" rel=\"noreferrer noopener\">Program ATtiny85 with Arduino Nano<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=gXXdoeu7yWw\" target=\"_blank\" rel=\"noreferrer noopener\">Programming ATtiny85\/84 with Arduino Uno (ATTinyCore)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=Z_MhVSlMZI8\" target=\"_blank\" rel=\"noreferrer noopener\">Program the ATTINY85 with Arduino 1.8.18 (2022)<\/a><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">ICSP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In one of the references, the <a href=\"https:\/\/en.wikipedia.org\/wiki\/In-system_programming\" target=\"_blank\" rel=\"noreferrer noopener\">ICSP<\/a> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Pin_header\" target=\"_blank\" rel=\"noreferrer noopener\">header<\/a> is used, rather than the pins D11, D12 and D13 as seen in most examples. Because of the header name, this also seems to have been the intented use for an Arduino board as a programmer. Looking at the <a href=\"https:\/\/en.wikipedia.org\/wiki\/In-system_programming\" target=\"_blank\" rel=\"noreferrer noopener\">ISP<\/a> example &#8216;ArduinoISP.ino&#8217; in the <a href=\"https:\/\/www.arduino.cc\/en\/software\" target=\"_blank\" rel=\"noreferrer noopener\">Arduino IDE<\/a> below File -&gt; Examples -&gt; 11. ArduinoISP -&gt; ArduinoISP, the comment reads:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ By default, the hardware SPI pins MISO, MOSI and SCK are used to communicate\n\/\/ with the target. On all Arduinos, these pins can be found\n\/\/ on the ICSP\/SPI header:\n\/\/\n\/\/               MISO \u00b0. . 5V (!) Avoid this pin on Due, Zero...\n\/\/               SCK   . . MOSI\n\/\/                     . . GND<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is confirmed on e.g. <a href=\"https:\/\/arduino.stackexchange.com\/a\/30027,\">https:\/\/arduino.stackexchange.com\/a\/30027,<\/a> where it states: &#8220;The standard connection for the ISP is a 100 mil 6-pin header (2&#215;3).&#8221; The <a href=\"https:\/\/i.stack.imgur.com\/nxknS.png\" target=\"_blank\" rel=\"noreferrer noopener\">image from this answer<\/a> shows the pin assignment for the ICSP header of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Arduino_Uno\" target=\"_blank\" rel=\"noreferrer noopener\">Uno<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      1 2\nMISO  . .  VTG\n SCK  . .  MOSI\n RST  . .  GND\n      5 6<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"796\" height=\"636\" src=\"https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/0013b-Uno-only-bb.png\" alt=\"\" class=\"wp-image-2388\" srcset=\"https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/0013b-Uno-only-bb.png 796w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/0013b-Uno-only-bb-300x240.png 300w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/0013b-Uno-only-bb-768x614.png 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/><figcaption class=\"wp-element-caption\">ICSP headers on Arduino Uno<br>Image created with <a href=\"https:\/\/fritzing.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fritzing<\/a><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">With both Uno and Nano rotated with the USB port pointing to the left you may notice that pin 1 is at the botom for the Nano, not at the top as with the Uno. If you look at it from that orientation, this is the pin assignment for the ICSP header of the Nano:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      6 5\n GND  . .  RST\nMOSI  . .  SCK\n VTG  . .  MISO\n      2 1<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"258\" src=\"https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/0013c-Nano-only-bb.png\" alt=\"\" class=\"wp-image-2391\" srcset=\"https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/0013c-Nano-only-bb.png 532w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/0013c-Nano-only-bb-300x145.png 300w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><figcaption class=\"wp-element-caption\">ICSP headers on Arduino Nano<br>Image created with <a href=\"https:\/\/fritzing.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fritzing<\/a><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This confused me a bit at first, but it&#8217;s the exact same header. It just depends on the board&#8217;s orientation where to find the correct pin numbers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Lesson learned:<\/em> Make sure to locate pin 1, before connecting any cables.<br>Look for a small dot or a small 1.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>TODO<\/strong> add macro photo&#8217;s from Uno and Nano pin 1 indication<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The key pins for <a href=\"https:\/\/en.wikipedia.org\/wiki\/In-system_programming\" target=\"_blank\" rel=\"noreferrer noopener\">ICSP<\/a> seem to be MISO, MOSI and SCK. After locating them on the Nano ICSP header, the matching pins on the ATtiny85 also need to be located. As suggested in the references, look for the chip&#8217;s datasheet and find the section that describes the pins.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"357\" src=\"https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/ATTiny85-Pinout-1024x357.png\" alt=\"\" class=\"wp-image-2394\" srcset=\"https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/ATTiny85-Pinout-1024x357.png 1024w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/ATTiny85-Pinout-300x105.png 300w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/ATTiny85-Pinout-768x268.png 768w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/ATTiny85-Pinout-1536x536.png 1536w, https:\/\/fotografeer.nl\/wp-content\/uploads\/2022\/12\/ATTiny85-Pinout-2048x715.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now the needed data to connect the wires is available for both the programmer (Nano) and the peripheral (ATtiny85). From that we can deduct what to connect where and assign some colors for the wires.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>Nano ICSP Header      ATtiny85               wire color<\/strong>\nPin 1 MISO            Pin 6 PB1 (MISO)       Blue\nPin 2 +5V             Pin 8 VCC              Red\nPin 3 SCK             Pin 7 PB1 (SCK)        White\nPin 4 MOSI            Pin 6 PB0 (MOSI)       Brown\nPin 6 GND             Pin 4 GND              Black\n<strong>Nano standard pin<\/strong>                          \nPin D10               Pin 1 PB5 (RESET)      Orange<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Indicator LEDs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In ref 1 and in the ArduinoISP example, there is a comment on using LEDs (with resistor), to indicate the status of the programmer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Put an LED (with resistor) on the following pins:\n\/\/ 9: Heartbeat   - Shows the programmer is running\n\/\/ 8: Error       - Lights up if something goes wrong (use red if that makes sense)\n\/\/ 7: Programming - In communication with the slave<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This was added to the challenge aswell. This led to a design for Arduino Nano to be used as a programmer for ATtiny85 via the ICSP header with indicator LEDs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The next blog post will feature the design.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">DISCLAIMER<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">THIS BLOG POST IS PROVIDED &#8220;AS IS&#8221;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THIS HOWTO OR SOFTWARE OR THE USE OR OTHER DEALINGS IN THIS BLOG POST.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to program an ATtiny85 chip from a Arduino Nano 1\/8<\/p>\n","protected":false},"author":2,"featured_media":2600,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[69],"tags":[102,104,106,138],"class_list":["post-2367","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog___en","tag-arduino___en","tag-attiny85___en","tag-nano___en","tag-programming___en"],"lang":"en","translations":{"en":2367,"nl":2457},"pll_sync_post":{},"_links":{"self":[{"href":"https:\/\/fotografeer.nl\/index.php?rest_route=\/wp\/v2\/posts\/2367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fotografeer.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fotografeer.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fotografeer.nl\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fotografeer.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2367"}],"version-history":[{"count":20,"href":"https:\/\/fotografeer.nl\/index.php?rest_route=\/wp\/v2\/posts\/2367\/revisions"}],"predecessor-version":[{"id":2452,"href":"https:\/\/fotografeer.nl\/index.php?rest_route=\/wp\/v2\/posts\/2367\/revisions\/2452"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fotografeer.nl\/index.php?rest_route=\/wp\/v2\/media\/2600"}],"wp:attachment":[{"href":"https:\/\/fotografeer.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fotografeer.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fotografeer.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}