{"id":15378,"date":"2022-07-08T16:34:12","date_gmt":"2022-07-08T16:34:12","guid":{"rendered":"https:\/\/wolles-elektronikkiste.de\/programming-attiny-with-arduino-code"},"modified":"2025-02-02T10:56:37","modified_gmt":"2025-02-02T10:56:37","slug":"programming-attiny-with-arduino-code","status":"publish","type":"post","link":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code","title":{"rendered":"Programming ATtiny with Arduino code"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">About this post<\/h2>\n\n<p>Some time ago, I had written a post about &#8220;<a href=\"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny85-84-45-44-25-24\" target=\"_blank\" rel=\"noopener\">Programming ATtiny85 \/ 84 \/ 45 \/ 44 \/25 \/ 24<\/a>&#8220;. I had used the board manager package &#8220;<a href=\"https:\/\/github.com\/damellis\/attiny\">attiny<\/a>&#8221; by David A. Mellis at that point of time. However, there is another package called <a href=\"https:\/\/github.com\/SpenceKonde\/ATTinyCore\" target=\"_blank\" rel=\"noopener\">ATTinyCore<\/a> from Spence Konde, which covers many more representatives of the ATtiny family and is considerably more convenient. In addition, both the range of functions and the differences of the individual representatives of the ATtiny family are documented excellently.<\/p>\r\n\r\n<p>So, it&#8217;s time for a new post on this topic! Here&#8217;s what&#8217;s coming your way:<\/p>\r\n<ul>\r\n \t<li><a href=\"#attinycore_vs_attiny\">Advantages of ATTinyCore vs. attiny<\/a><\/li>\r\n \t<li><a href=\"#attiny_family\">The ATtiny Family &#8211; Overview<\/a><\/li>\r\n \t<li><a href=\"#preparation_ide\">Preparing the Arduino IDE<\/a><\/li>\r\n \t<li><a href=\"#sketch_upload\">Uploading sketches to the ATtiny<\/a>\r\n<ol>\r\n \t<li><a href=\"#isp_upload\">Without bootloader (ISP)<\/a>\r\n<ul>\r\n \t<li><a href=\"#arduino_as_ISP\">The Arduino as ISP Programmer<\/a><\/li>\r\n \t<li><a href=\"#other_ISP_programmer\">Use other ISP programmers<\/a><\/li>\r\n<\/ul>\r\n<\/li>\r\n \t<li><a href=\"#optiboot_upload\">With Optiboot bootloader<\/a><\/li>\r\n \t<li><a href=\"#micronucleus_upload\">Micronucleus &#8211; we are building a Digispark!<\/a><\/li>\r\n<\/ol>\r\n<\/li>\r\n \t<li><a href=\"#upload_isp_und_serial_monitor\">Uploadind via ISP <em>and<\/em> using the serial monitor<\/a><\/li>\r\n<\/ul>\n\n<h2 class=\"wp-block-heading\" id=\"attinycore_vs_attiny\">Advantages of ATTinyCore vs. attiny<\/h2>\n\n<p>ATTinyCore can do everything the older package &#8220;attiny&#8221; can do, only more. Here are the most important advantages from my point of view:<\/p>\r\n<ul>\r\n<li>You can currently program 20 ATtiny MCUs instead of 6.<\/li>\r\n<li>ATTinyCore handles I2C, SPI and UART (Serial) without the need for additional libraries.<\/li>\r\n<li>Larger bootloader selection (does not apply to all representatives, though):\r\n<ul>\r\n<li>Without, i.e. programming via ISP.<\/li>\r\n<li>Optiboot, i.e. &#8220;Arduino-like&#8221; programming via serial.<\/li>\r\n<li>Micronucleus (VUSB), i.e. programming \u00e0 la Digispark.<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>More fine-tuning is possible, like (de)activating micros()\/millis() or setting the BOD level (Brown Out Detection).<\/li>\r\n<\/ul>\r\n<p>I would like to emphasize the second point in particular. Most ATtinys have a so-called USI interface (Universal Serial Interface) instead of a &#8220;real&#8221; I2C, SPI and UART interface. It is possible to implement I2C, SPI and UART using the USI interface, but this requires a corresponding software solution. And exactly this is already implemented in ATTinyCore.&nbsp;<\/p>\r\n\n<h2 class=\"wp-block-heading\" id=\"attiny_family\">The ATtiny Family &#8211; Overview<\/h2>\n\n<p>I counted in <a href=\"https:\/\/www.microchip.com\/en-us\/tools-resources\/develop\/microchip-studio\" target=\"_blank\" rel=\"noopener\">Microchip Studio<\/a> (formerly Atmel Studio), the software from <a href=\"https:\/\/www.microchip.com\/\" target=\"_blank\" rel=\"noopener\">Microchip<\/a> for programming the AVR and SAM microcontrollers: There you can choose between 75 different ATtiny MCUs. Quite a large family, I would say.<\/p>\r\n\n<h3 class=\"wp-block-heading\">Which ATtinys you can program with ATTinyCore<\/h3>\n\n<p>Here is a list of ATtiny MCUs which are suitable for ATtinyCore:<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/overview_attinys-1024x564.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"564\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/overview_attinys-1024x564.png\" alt=\"ATtiny types you can program with ATTinyCore.\" class=\"wp-image-14706\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/overview_attinys-1024x564.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/overview_attinys-300x165.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/overview_attinys-768x423.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/overview_attinys-1320x728.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/overview_attinys.png 1386w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">ATtiny types you can program with ATTinyCore.<\/figcaption><\/figure>\n\n<p>The table lists only a few technical features of the ATtinys. If you want to know more and don&#8217;t feel like reading long datasheets, I can really highly recommend browsing through the <a href=\"https:\/\/github.com\/SpenceKonde\/ATTinyCore\" target=\"_blank\" rel=\"noopener\">ATTinyCore documentation<\/a> on GitHub.<\/p>\r\n\n<h3 class=\"wp-block-heading\">Not covered ATtiny types in ATtinyCore<\/h3>\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/megaTinyCore_attiny_list.png\"><img loading=\"lazy\" decoding=\"async\" width=\"280\" height=\"407\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/megaTinyCore_attiny_list.png\" alt=\"\" class=\"wp-image-14710\" style=\"width:140px;height:204px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/megaTinyCore_attiny_list.png 280w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/megaTinyCore_attiny_list-206x300.png 206w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" \/><\/a><\/figure>\n<\/div>\n<p>There is another package from Spence Konde called <a href=\"https:\/\/github.com\/SpenceKonde\/megaTinyCore\" target=\"_blank\" rel=\"noopener\">megaTinyCore<\/a>. This covers the ATtiny types listed on the right, which are fundamentally different from the other family members. They are not programmed via ISP, but via UPDI&nbsp; (Universal Programming and Debugging Interface). UPDI is a &#8220;single-wire&#8221; method, which means it runs over a single data cable.<\/p>\r\n<p>I will write a separate post about the UPDI-based ATtinys later. First, I still have to familiarize myself with it.<\/p>\r\n\n<h3 class=\"wp-block-heading\">Why should I use ATtiny MCUs?<\/h3>\n\n<p style=\"text-align: left;\">If you compare the performance of ATtiny MCUs with those of an ESP32, ESP8266 or ATmega types, the ATtinys do not necessarily look good. BUT: They are small, they are power efficient, and they are usually cheap. For many projects, the large MCUs are oversized.<\/p>\r\n\n<h2 class=\"wp-block-heading\" id=\"preparation_ide\">Preparing the Arduino IDE<\/h2>\n\n<p><strong>Update 01\/2025: the latest version of the board package is 2.0.0. You can only install it manually. On <a href=\"https:\/\/github.com\/SpenceKonde\/ATTinyCore#attinycore-200-is-available-for-public-test-things-that-dont-work-should-be-reported\" target=\"_blank\" rel=\"noopener\">GitHub<\/a>, you will find a note that this is a test version. Moreover, Spence Konde recommends using the outdated Arduino IDE 1.8.13 (see <a href=\"https:\/\/github.com\/SpenceKonde\/ATTinyCore?tab=readme-ov-file#current-strongly-recommended-ide-version-1813\" target=\"_blank\" rel=\"noopener\">here<\/a>). Unfortunately, no further updates were made after the launch of version 2.0.0. As problems have been reported with this version, I recommend installing version 1.5.2 first. You can install this version (now again) via the Arduino IDE. If everything works, you can try out version 2.0.0 and install it in parallel. <\/strong><\/p>\r\n\n<h3 class=\"wp-block-heading\">Installation of Version 2.0.0 (I do not recommend)<\/h3>\n\n<ol>\r\n<li><strong>Follow <a href=\"https:\/\/github.com\/SpenceKonde\/ATTinyCore\" target=\"_blank\" rel=\"noopener\">this link<\/a>, click on the green field &#8220;&lt;&gt; Code&#8221; and then on &#8220;Download ZIP&#8221;.<\/strong><\/li>\r\n<li><strong>Save the ZIP file in the &#8220;hardware&#8221; subdirectory in your sketchbook directory (i.e. where your sketches are located). If the &#8220;hardware&#8221; directory does not exist, create it. If you do not know where your Sketchbook directory is located, go to File \u2192 Settings. There you find the information at the top.<\/strong><\/li>\r\n<li><strong>Extract the ZIP file.  If your ZIP program does not create the directory \u201cATTinyCore-2.0.0-devThis-is-the-head-submit-PRs-against-this\u201d (possibly with a different version number) directly under \u201chardware\u201d, then move it there. I would also recommend renaming the unwieldy name to \u201cATTinyCore 2.x.x\u201d.<\/strong><\/li>\r\n<\/ol>\r\n\n<h3 class=\"wp-block-heading\">Installation of Version 1.5.2 (Should be prefered) <\/h3>\n\n<p><span style=\"color: #000000;\">In the Arduino IDE, go to File \u2192 Settings. Click the icon next to &#8220;Additional Boards Manager URLs&#8221;. In the window that pops up, enter the following line:<\/span><\/p>\r\n<p><span style=\"color: #000000;\">https:\/\/descartes.net\/package_drazzy.com_index.json<\/p>\r\n<p><span style=\"color: #000000;\">Then close the windows by clicking &#8220;OK&#8221;.<\/span><\/p>\r\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/board_mgr_urls_new.png\"><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"506\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/board_mgr_urls_new.png\" alt=\"\" class=\"wp-image-23022\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/board_mgr_urls_new.png 764w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/board_mgr_urls_new-300x199.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/a><figcaption class=\"wp-element-caption\">Add boards manager URL for ATTinyCore<\/figcaption><\/figure>\n\n<p><span style=\"color: #999999;\">Now navigate to Tools \u2192 Board \u2192 Boards Manager. Enter &#8220;attiny&#8221; as a search term and install ATTinyCore from Spence Konde. <\/span><\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/ATTinyCore_Package.png\"><img loading=\"lazy\" decoding=\"async\" width=\"448\" height=\"292\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/ATTinyCore_Package.png\" alt=\"ATtiny programming with the Arduino IDE: Installing the ATTinyCore package\" class=\"wp-image-20244\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/ATTinyCore_Package.png 448w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/ATTinyCore_Package-300x196.png 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/a><figcaption class=\"wp-element-caption\">Installing the ATTinyCore package<\/figcaption><\/figure>\n<\/div>\n<p>If everything works, you should now find ATTinyCore among the selectable board groups:<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/attiny_board_selection-1024x431.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"431\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/attiny_board_selection-1024x431.png\" alt=\"Huge variety of ATtinys and options after installation of ATtinyCore\" class=\"wp-image-20246\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/attiny_board_selection-1024x431.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/attiny_board_selection-300x126.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/attiny_board_selection-768x324.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/attiny_board_selection-1320x556.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2024\/03\/attiny_board_selection.png 1467w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Huge variety of ATtinys and options<\/figcaption><\/figure>\n\n<h2 class=\"wp-block-heading\" id=\"sketch_upload\">Upload sketches to the ATtiny<\/h2>\n\n<p>Now comes the more interesting part because now we upload sketches to the ATtiny. There are, as already mentioned, three methods. As a demonstration object, I use the popular ATtiny85. However, I have also successfully tested an ATtiny4313, an ATtiny861 and an ATtiny1634 with the options available in each case.<\/p>\r\n<p>For better orientation, here is the pinout of the ATtiny85:<\/p>\r\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Attiny25_45_85-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"187\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Attiny25_45_85-1-1024x187.png\" alt=\"Pinout of the ATtiny85\" class=\"wp-image-2136\" style=\"width:840px;height:153px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Attiny25_45_85-1-1024x187.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Attiny25_45_85-1-300x55.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Attiny25_45_85-1-768x140.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Attiny25_45_85-1.png 1111w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Pinout of the ATtiny85<\/figcaption><\/figure>\n\n<p>The methods presented here can be easily transferred to the other ATtinys. <\/p>\r\n\n<h3 class=\"wp-block-heading\" id=\"isp_upload\">Option 1: Upload without bootloader (ISP)<\/h3>\n\n<p>The most common, &#8220;natural&#8221; way to program a microcontroller is ISP (In-System Programming). The designation is intended to make clear that the microcontroller can be programmed in its application environment. Therefore, it does not need to be prepared separately before its installation.<\/p>\r\n<p>The ISP programming is done via the pins of the SPI interface. Since the pin designations are also the same (MOSI, MISO, SCK), the wiring is simple.<\/p>\r\n\n<h4 class=\"wp-block-heading\" id=\"arduino_as_ISP\">Variant 1: The Arduino as ISP Programmer<\/h4>\n\n<h5 class=\"wp-block-heading\">Preparation<\/h5>\n\n<p>The bad news is that you need a programmer to program via ISP. The good news is that you can turn an Arduino UNO or Nano into a programmer. You only have to do one thing:<\/p>\r\n<ul>\r\n<li>Upload the ArduinoISP sketch to the board that will serve as the programmer. You can find the sketch in the Arduino IDE under File \u2192 Examples \u2192 Built-In Examples \u2192 ArduinoISP.<\/li>\r\n<\/ul>\r\n<p>Now connect the programmer you just created to the ATtiny as follows (Arduino Nano as example):<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/ardu_nano_as_programmer_for_attiny85-1024x623.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"623\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/ardu_nano_as_programmer_for_attiny85-1024x623.png\" alt=\"Arduino Nano as ISP Programmer for the ATtiny85\" class=\"wp-image-15605\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/ardu_nano_as_programmer_for_attiny85-1024x623.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/ardu_nano_as_programmer_for_attiny85-300x183.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/ardu_nano_as_programmer_for_attiny85-768x467.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/ardu_nano_as_programmer_for_attiny85.png 1180w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Arduino Nano as ISP Programmer for the ATtiny85<\/figcaption><\/figure>\n\n<p>On the Arduino board, MOSI is the digital pin 11, MISO is 12 and SCK is 13. Where the corresponding pins of the microcontroller are located is easy to find out via its pinout scheme. Connect the digital pin 10 of the Arduino to the reset pin of the ATtiny. Connect a capacitor (10 \u00b5F) to the reset pin of the Arduino. We will use the LED at PB4 later. You do not need it for programming.<\/p>\r\n<p>If you have <em>first<\/em> built the circuit and <em>then<\/em> want to upload the ArduinoISP sketch, the capacitor can cause problems. Remove it when uploading.<\/p>\r\n\n<h5 class=\"wp-block-heading\">Uploading<\/h5>\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/settings_attiny85.png\"><img loading=\"lazy\" decoding=\"async\" width=\"503\" height=\"278\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/settings_attiny85.png\" alt=\"Settings for the ATtiny in the Arduino IDE\" class=\"wp-image-14727\" style=\"width:377px;height:209px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/settings_attiny85.png 503w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/settings_attiny85-300x166.png 300w\" sizes=\"auto, (max-width: 503px) 100vw, 503px\" \/><\/a><figcaption class=\"wp-element-caption\">Settings for the ATtiny85<\/figcaption><\/figure>\n<\/div>\n<p>Now select the board family and the microcontroller in the Arduino IDE.<\/p>\r\n<p>Then you can adjust some settings, such as the clock rate. It is best to leave the other setting options unchanged for now.<\/p>\r\n<p>Choose &#8220;Arduino as ISP&#8221; as programmer.<\/p>\r\n<p>Before the sketch upload, click on &#8220;Burn bootloader&#8221;. This is misleading because no bootloader is burned, only the so-called fuse bits are set. These are non-volatile, i.e. permanently set bits, with which the settings just described are applied to the microcontroller.<\/p>\r\n<p>And now you can finally upload a sketch. In the new Arduino IDE (version &gt;= 2.0) you have to press Ctrl + Shift + u, or you navigate to: <em>Sketch \u2192 Upload using programmer<\/em>.I usually test first to see if a simple blink sketch like the following works:<\/p>\r\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"blink.ino\" data-enlighter-title=\"blink.ino\">int ledPin = 4;\r\n\r\nvoid setup() {\r\n  pinMode(ledPin, OUTPUT);\r\n}\r\n\r\nvoid loop() {\r\n  digitalWrite(ledPin, HIGH);   \r\n  delay(500);                     \r\n  digitalWrite(ledPin, LOW);    \r\n  delay(500);                     \r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n\n<h4 class=\"wp-block-heading\" id=\"other_ISP_programmer\">Variant 2: Using other ISP programmers<\/h4>\n\n<h5 class=\"wp-block-heading\">Programmer overview<\/h5>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Programmer.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"481\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Programmer-1024x481.jpg\" alt=\"\" class=\"wp-image-1812\" style=\"width:768px;height:361px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Programmer-1024x481.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Programmer-300x141.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Programmer-768x361.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/Programmer.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">USBtinyISP programmer<\/figcaption><\/figure>\n<\/div><div class=\"wp-block-image\">\n<figure class=\"alignright size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ISP_breadboard_adapter-1024x770.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"770\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ISP_breadboard_adapter-1024x770.jpg\" alt=\"ISP breadboard adapter\" class=\"wp-image-14658\" style=\"width:256px;height:193px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ISP_breadboard_adapter-1024x770.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ISP_breadboard_adapter-300x226.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ISP_breadboard_adapter-768x577.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ISP_breadboard_adapter.jpg 1136w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">ISP breadboard adapter<\/figcaption><\/figure>\n<\/div>\n<p>If you are passionate about ATtiny programming, I recommend buying an ISP programmer A cheap option is the USBtinyISP, which you can get for &lt;10 Euro e.g. on Amazon. If a driver is needed, check <a href=\"https:\/\/learn.adafruit.com\/usbtinyisp\/drivers\" target=\"_blank\" rel=\"noopener\">here<\/a> at Adafruit.<\/p>\r\n<p>It is best to invest in an ISP breadboard adapter (right), which will make your life much easier and reduce the risk of incorrect wiring.<\/p>\r\n<p>USBasp programmers are similarly priced. For the piece I bought (see below), there was even a good <a href=\"https:\/\/paradisetronic.com\/files\/tutorials\/USBasp_ISP_Programmer_DE.pdf\">manual<\/a> available, which is otherwise unfortunately rare.<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USBasp-1024x356.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"356\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USBasp-1024x356.jpg\" alt=\"\" class=\"wp-image-14772\" style=\"width:512px;height:178px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USBasp-1024x356.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USBasp-300x104.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USBasp-768x267.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USBasp-1536x533.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USBasp-2048x711.jpg 2048w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USBasp-1320x458.jpg 1320w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">USBasp Programmer<\/figcaption><\/figure>\n<\/div>\n<p>A slightly more expensive programmer, but one that also works with the Arduino IDE and Microchip Studio, is the Diamex USB-ISP. You can get it <a href=\"https:\/\/www.diamex.de\/dxshop\/USB-ISP-Programmer-fuer-Atmel-AVR\" target=\"_blank\" rel=\"noopener\">here<\/a> for just over 20 Euros. Alternatively, these pieces are available as Tremex USB ISP Programmer in online shops.<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_ISP_Programmer-1024x725.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"725\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_ISP_Programmer-1024x725.jpg\" alt=\"Diamex \/ Tremex USB-ISP Programmer\" class=\"wp-image-14734\" style=\"width:512px;height:363px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_ISP_Programmer-1024x725.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_ISP_Programmer-300x213.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_ISP_Programmer-768x544.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_ISP_Programmer.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Diamex USB-ISP Programmer<\/figcaption><\/figure>\n<\/div>\n<p>The luxury variant is the <a href=\"https:\/\/www.microchip.com\/en-us\/development-tool\/ATATMEL-ICE\" target=\"_blank\" rel=\"noopener\">ATATMEL-ICE Programmer<\/a> (ishort: ATMEL-ICE). It works with the Arduino IDE, with Microchip Studio, handles debugWire and UPID. But then you&#8217;ll have to pay around 150 Euros&#8230;<\/p>\r\n\n<h5 class=\"wp-block-heading\">Connection to the ATtiny and upload<\/h5>\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ISP_Anschluss.png\"><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"600\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ISP_Anschluss.png\" alt=\"ISP connection diagram\" class=\"wp-image-2068\" style=\"width:202px;height:150px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ISP_Anschluss.png 808w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ISP_Anschluss-300x223.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ISP_Anschluss-768x570.png 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><\/a><\/figure>\n<\/div>\n<p>The connection to the ATtiny is self-explanatory using the schematic for the ISP connector shown on the right.<\/p>\r\n<p>Since it is easy to make a mistake, I repeat myself and recommend the already mentioned adapter for breadboard circuits.<\/p>\r\n<p>To upload sketches, select the target microcontroller in the Arduino IDE, the programmer and burn the bootloader before the first upload. Then you can upload the first example sketch.<\/p>\r\n\n<h3 class=\"wp-block-heading\" id=\"optiboot_upload\">Option 2 &#8211; Upload with Optiboot Bootloader<\/h3>\n\n<h4 class=\"wp-block-heading\">About the Optiboot Bootloader<\/h4>\n\n<p>This method is the one that is also used on the Arduino boards. The Optiboot bootloader ensures that the sketches are uploaded via the serial interface (USI with ATtiny, otherwise UART). The advantage is that fewer lines are needed than when uploading via ISP. Also, you can use the serial monitor as if you were using an Arduino development board. The big drawback is that the bootloader takes up almost 600 bytes of flash memory. Therefore, ATTinyCore does not support the Optiboot bootloader for the ATtinys with 2 KB memory.<\/p>\r\n\n<h4 class=\"wp-block-heading\">Burning the bootloader<\/h4>\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"269\" height=\"83\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/Optiboot.png\" alt=\"\" class=\"wp-image-14744\"\/><\/figure>\n<\/div>\n<p>Unfortunately, you still have to burn the Optiboot bootloader via ISP. I.e. at least once you have to apply one of the previously described procedures (option 1 or 2). When setting the target microcontroller, select the Optiboot variant.<\/p>\r\n\n<h4 class=\"wp-block-heading\">USB to TTL Adapter<\/h4>\n\n<p>To enable the USB interface of your PC to communicate with the serial interface of the ATtiny, you need an adapter. You can find these in online shops for a few Euros under the name &#8220;USB-to-TTL&#8221;, &#8220;USB-UART&#8221; or &#8220;FT232RL-FTDI&#8221; adapter.<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_zu_TTL-1024x945.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"945\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_zu_TTL-1024x945.jpg\" alt=\"Various USB to TTL serial adapters for ATtiny programming\" class=\"wp-image-14747\" style=\"width:512px;height:473px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_zu_TTL-1024x945.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_zu_TTL-300x277.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_zu_TTL-768x708.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_zu_TTL-1320x1218.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/USB_zu_TTL.jpg 1404w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Various USB to TTL Serial Adapters<\/figcaption><\/figure>\n<\/div>\n<h4 class=\"wp-block-heading\">Connection to the ATtiny<\/h4>\n\n<p>Connect the RX pin of your adapter to AIN0 of the ATtiny and TX to AIN1. Then connect VCC with VCC and GND with GND. The button at the reset pin of the ATtiny shall only indicate that you can pull it down to LOW if needed. While the sketch is being compiled before the upload, you put the ATtiny into the reset state by connecting it to GND. Then, when the actual upload is to take place, the process pauses. The upload starts when you disconnect the Reset-GND connection. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/serial_programming_ftdi.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"687\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/serial_programming_ftdi.png\" alt=\"\" class=\"wp-image-14661\" style=\"width:767px;height:515px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/serial_programming_ftdi.png 1023w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/serial_programming_ftdi-300x201.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/serial_programming_ftdi-768x516.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/a><figcaption class=\"wp-element-caption\">ATtiny &#8211; Connection to a USB to TTL Serial Adapter<\/figcaption><\/figure>\n<\/div>\n<p>Alternatively to the pushbutton, you can use the DTR pin of the adapter for the upload. This is much more convenient. For this, you have to connect the DTR pin of the adapter with the reset pin of the ATtiny via a capacitor and add a pull-up resistor:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/DTR_connect-1024x434.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"434\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/DTR_connect-1024x434.png\" alt=\"Upload using the DTR pin\" class=\"wp-image-15403\" style=\"width:256px;height:109px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/DTR_connect-1024x434.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/DTR_connect-300x127.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/DTR_connect-768x326.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/07\/DTR_connect.png 1184w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Upload using the DTR pin<\/figcaption><\/figure>\n<\/div>\n<p><strong><span style=\"color: #ff0000;\">Important note<\/span>: the Serial Monitor must be closed for the program upload via Serial!<\/strong><\/p>\r\n\n<h4 class=\"wp-block-heading\">Uploading sketches <\/h4>\n\n<p>Select the port to which the USB-to-TTL adapter is connected. It doesn&#8217;t matter which programmer you set. Now upload your sketch. To do this, wait until the sketch is compiled, and the actual upload should begin. Then perform a reset on the ATtiny. This is where the pushbutton comes in (or the DTR pin). I have extended the test sketch a bit to check if the output on the serial monitor works.<\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"attiny85_serial_programming_test.ino\" data-enlighter-title=\"attiny85_serial_programming_test.ino\">const int ledPin = 4;\r\n\r\nvoid setup() {\r\n  Serial.begin(9600);\r\n  pinMode(ledPin, OUTPUT);\r\n}\r\n\r\nvoid loop() {\r\n  Serial.println(\"Hello World\");\r\n  digitalWrite(ledPin, HIGH);   \r\n  delay(500);                     \r\n  digitalWrite(ledPin, LOW);    \r\n  delay(500);                     \r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n\n<h3 class=\"wp-block-heading\" id=\"micronucleus_upload\">Option 3 &#8211; Micronucleus: we build a Digispark!<\/h3>\n\n<h4 class=\"wp-block-heading\">About the Micronucleus<\/h4>\n\n<p>The Micronucleus is the bootloader used on the <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/digispark-the-convenient-attiny85-alternative\" target=\"_blank\" rel=\"noopener\">Digispark boards<\/a>. Thereby the ATtiny is programmed directly via USB without adapter. To make this possible, the Micronucleus uses a technique called VUSB. This means that components that do not have a hardware USB interface can also be addressed via USB.<\/p>\r\n<p>A certain advantage of the Micronucleus is that you can convert the reset pin of the ATtiny into a GPIO. The disadvantage is &#8211; as with the Optiboot &#8211; the reduction of the available flash memory. Unfortunately, the memory requirements of the Micronucleus are even greater. From the 8192 bytes of an ATtiny85, you have only 6586 bytes left for your sketches.<\/p>\r\n\n<h4 class=\"wp-block-heading\">Preparation<\/h4>\n\n<p>If you haven&#8217;t worked with Digispark yet, you will first need to install a driver for the Micronucleus, which you can download <a href=\"https:\/\/github.com\/digistump\/DigistumpArduino\/releases\/download\/1.6.7\/Digistump.Drivers.zip\" target=\"_blank\" rel=\"noopener\">here<\/a>. Unzip the file and run &#8220;Install Drivers.exe&#8221; for a 32-bit system or &#8220;DPInst64.exe&#8221; for a 64-bit system.<\/p>\r\n<p>Then you have to burn the bootloader once via ISP (&#8220;Fresh Install&#8221;):<\/p>\r\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/bootloader_digispark.png\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"178\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/bootloader_digispark.png\" alt=\"Burn bootloader - Arduino IDE options\" class=\"wp-image-14757\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/bootloader_digispark.png 660w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/bootloader_digispark-300x81.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><figcaption class=\"wp-element-caption\">Burn bootloader &#8211; Arduino IDE options<\/figcaption><\/figure>\n\n<p>For the reset pin you can choose &#8220;Reset&#8221; or &#8220;GPIO&#8221;. With &#8220;GPIO&#8221; you have one GPIO more available, but you can&#8217;t program the ATtiny via ISP anymore. You would first have to perform a bootloader upgrade via USB and give the reset pin back its reset function. <\/p>\r\n\n<h4 class=\"wp-block-heading\">Wiring<\/h4>\n\n<p>For the circuit you need, besides the ATtiny, two 68 \u03a9 resistors, one 1.5 k\u03a9 resistor and two 3.6 volt Zener diodes. The Zener diodes are used to protect the USB interface of your computer because the data lines use 3.3 volts. So be careful what you do!<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_digispark_wiring-1024x607.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"607\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_digispark_wiring-1024x607.png\" alt=\"Circuit for ATtiny programming using the Micronucleus bootloader\" class=\"wp-image-14664\" style=\"width:768px;height:455px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_digispark_wiring-1024x607.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_digispark_wiring-300x178.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_digispark_wiring-768x455.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_digispark_wiring-1320x783.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_digispark_wiring.png 1513w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Circuit for programming using the Micronucleus bootloader<\/figcaption><\/figure>\n<\/div>\n<p>For the USB connection, I recommend a USB break-out module, which you can get for &lt; 1 Euro in online-shops This is how the circuit looked like on the breadboard:<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_as_digispark-1024x666.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"666\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_as_digispark-1024x666.jpg\" alt=\"\" class=\"wp-image-14666\" style=\"width:768px;height:500px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_as_digispark-1024x666.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_as_digispark-300x195.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_as_digispark-768x500.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_as_digispark-1536x999.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_as_digispark-2048x1332.jpg 2048w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/attiny85_as_digispark-1320x859.jpg 1320w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Breadboard circuit \u00e0 la Digispark <\/figcaption><\/figure>\n<\/div>\n<p>Which pins to connect to the USB lines when using other ATtinys can be found in the ATTinyCore documentation on GitHub. Follow <a href=\"https:\/\/github.com\/SpenceKonde\/ATTinyCore#attinycore-universal-1\" target=\"_blank\" rel=\"noopener\">this link<\/a> and then click on the ATtiny of your choice.<\/p>\r\n<p>The complete circuit diagram for a Digispark can be found <a href=\"https:\/\/s3.amazonaws.com\/digistump-resources\/files\/97a1bb28_DigisparkSchematic.pdf\" target=\"_blank\" rel=\"noopener\">here<\/a>. It includes the voltage regulator and the on-board LED. <\/p>\r\n\n<h4 class=\"wp-block-heading\">Uploading sketches <\/h4>\n\n<p>Uploading works like using a digispark. This means that you do <em>not<\/em> initially connect your circuit to the computer via USB. As programmer, you choose the &#8220;Micronucleus&#8221; in the Arduino IDE. Then you start the upload. You do not connect to the USB until prompted to do so:<\/p>\r\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/sketch_upload_micronucleus.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"104\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/sketch_upload_micronucleus.png\" alt=\"Upload via Micronucleus\" class=\"wp-image-14767\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/sketch_upload_micronucleus.png 1000w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/sketch_upload_micronucleus-300x31.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/sketch_upload_micronucleus-768x80.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><figcaption class=\"wp-element-caption\">Upload via Micronucleus<\/figcaption><\/figure>\n\n<h2 class=\"wp-block-heading\" id=\"upload_isp_und_serial_monitor\">Uploading via ISP <em>and<\/em> using the serial monitor<\/h2>\n\n<p>You don&#8217;t want a bootloader and still want to use the serial monitor? There are two options.<\/p>\r\n\n<h3 class=\"wp-block-heading\">Option 1: additionally use the USB to TTL Serial Adapter<\/h3>\n\n<p>To upload the sketches, proceed as described above for ISP and also connect the USB-to-TTL adapter. In the circuit below I use the serial pins AIN0 and AIN1 for this purpose. Alternatively, you can also set up a SoftwareSerial connection.<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ArduinoISP_w_Serial-1024x598.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"598\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ArduinoISP_w_Serial-1024x598.png\" alt=\"Arduino as ISP with USB to TTL adapter for serial monitor\" class=\"wp-image-14671\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ArduinoISP_w_Serial-1024x598.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ArduinoISP_w_Serial-300x175.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ArduinoISP_w_Serial-768x448.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/05\/ArduinoISP_w_Serial.png 1268w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Arduino as ISP with USB-to-TTL adapter for using the serial monitor<\/figcaption><\/figure>\n\n<h3 class=\"wp-block-heading\">Option 2: with modified ArduinoISP Sketch<\/h3>\n\n<p>I have found a nice alternative <a href=\"https:\/\/www.arduinoforum.de\/arduino-Thread-Serial-Monitor-als-Debughilfe-f%C3%BCr-den-ATtiny85-und-andere-ATMEL-Mikrocontroller\" target=\"_blank\" rel=\"noopener\">here<\/a>. Some clever person has modified the ArduinoISP sketch so that you don&#8217;t need an additional adapter to use the serial monitor. Very smart! I have tried it and it works fine. <\/p>\r\n\n<h2 class=\"wp-block-heading\">Acknowledgement <\/h2>\n\n<p>The ATTinyCore package from <a href=\"https:\/\/github.com\/SpenceKonde\" target=\"_blank\" rel=\"noopener\">Spence Konde<\/a> is just <strong>fantastic<\/strong>!&nbsp; Thank you very much.<\/p>\r\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ATTinyCore package enables you to program a large part of the ATtiny family via the Arduino IDE. I show how this works with or without bootloader.<\/p>\n","protected":false},"author":1,"featured_media":8006,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[543],"tags":[582,707,1814,751,1071,1817,1816,1818,1813,750,1815,713],"class_list":["post-15378","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-boards-and-microcontrollers","tag-attiny-en","tag-attiny85-en","tag-attinycore-en","tag-diamex-en","tag-ftdi232-en","tag-micronucleus-en","tag-optiboot-en","tag-serial-monitor","tag-spence-konde-en","tag-tremex-en","tag-usbasp-en","tag-usbtinyisp-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Programming ATtiny with Arduino code &#8226; Wolles Elektronikkiste<\/title>\n<meta name=\"description\" content=\"The ATTinyCore package enables you to program a large part of the ATtiny family via the Arduino IDE. I show how it works.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Programming ATtiny with Arduino code &#8226; Wolles Elektronikkiste\" \/>\n<meta property=\"og:description\" content=\"The ATTinyCore package enables you to program a large part of the ATtiny family via the Arduino IDE. I show how it works.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code\" \/>\n<meta property=\"og:site_name\" content=\"Wolles Elektronikkiste\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-08T16:34:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-02T10:56:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ATtiny_Bild.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"991\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Wolfgang Ewald\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wolfgang Ewald\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code\"},\"author\":{\"name\":\"Wolfgang Ewald\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"headline\":\"Programming ATtiny with Arduino code\",\"datePublished\":\"2022-07-08T16:34:12+00:00\",\"dateModified\":\"2025-02-02T10:56:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code\"},\"wordCount\":2563,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ATtiny_Bild.jpg\",\"keywords\":[\"ATtiny\",\"ATtiny85\",\"ATTInyCore\",\"Diamex\",\"FTDI232\",\"Micronucleus\",\"Optiboot\",\"serial monitor\",\"Spence Konde\",\"Tremex\",\"USBasp\",\"USBtinyISP\"],\"articleSection\":[\"Boards and Microcontrollers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code\",\"name\":\"Programming ATtiny with Arduino code &#8226; Wolles Elektronikkiste\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ATtiny_Bild.jpg\",\"datePublished\":\"2022-07-08T16:34:12+00:00\",\"dateModified\":\"2025-02-02T10:56:37+00:00\",\"description\":\"The ATTinyCore package enables you to program a large part of the ATtiny family via the Arduino IDE. I show how it works.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code#primaryimage\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ATtiny_Bild.jpg\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ATtiny_Bild.jpg\",\"width\":1200,\"height\":991},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/programming-attiny-with-arduino-code#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Programming ATtiny with Arduino code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\",\"name\":\"Wolles Elektronikkiste\",\"description\":\"Die wunderbare Welt der Elektronik\",\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\",\"name\":\"Wolfgang Ewald\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"width\":512,\"height\":512,\"caption\":\"Wolfgang Ewald\"},\"logo\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Programming ATtiny with Arduino code &#8226; Wolles Elektronikkiste","description":"The ATTinyCore package enables you to program a large part of the ATtiny family via the Arduino IDE. I show how it works.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code","og_locale":"en_US","og_type":"article","og_title":"Programming ATtiny with Arduino code &#8226; Wolles Elektronikkiste","og_description":"The ATTinyCore package enables you to program a large part of the ATtiny family via the Arduino IDE. I show how it works.","og_url":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code","og_site_name":"Wolles Elektronikkiste","article_published_time":"2022-07-08T16:34:12+00:00","article_modified_time":"2025-02-02T10:56:37+00:00","og_image":[{"width":1200,"height":991,"url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ATtiny_Bild.jpg","type":"image\/jpeg"}],"author":"Wolfgang Ewald","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Wolfgang Ewald","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code#article","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code"},"author":{"name":"Wolfgang Ewald","@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"headline":"Programming ATtiny with Arduino code","datePublished":"2022-07-08T16:34:12+00:00","dateModified":"2025-02-02T10:56:37+00:00","mainEntityOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code"},"wordCount":2563,"commentCount":1,"publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ATtiny_Bild.jpg","keywords":["ATtiny","ATtiny85","ATTInyCore","Diamex","FTDI232","Micronucleus","Optiboot","serial monitor","Spence Konde","Tremex","USBasp","USBtinyISP"],"articleSection":["Boards and Microcontrollers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code","url":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code","name":"Programming ATtiny with Arduino code &#8226; Wolles Elektronikkiste","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#website"},"primaryImageOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code#primaryimage"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ATtiny_Bild.jpg","datePublished":"2022-07-08T16:34:12+00:00","dateModified":"2025-02-02T10:56:37+00:00","description":"The ATTinyCore package enables you to program a large part of the ATtiny family via the Arduino IDE. I show how it works.","breadcrumb":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code#primaryimage","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ATtiny_Bild.jpg","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/06\/ATtiny_Bild.jpg","width":1200,"height":991},{"@type":"BreadcrumbList","@id":"https:\/\/wolles-elektronikkiste.de\/en\/programming-attiny-with-arduino-code#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/wolles-elektronikkiste.de\/en"},{"@type":"ListItem","position":2,"name":"Programming ATtiny with Arduino code"}]},{"@type":"WebSite","@id":"https:\/\/wolles-elektronikkiste.de\/en#website","url":"https:\/\/wolles-elektronikkiste.de\/en","name":"Wolles Elektronikkiste","description":"Die wunderbare Welt der Elektronik","publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wolles-elektronikkiste.de\/en?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46","name":"Wolfgang Ewald","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","width":512,"height":512,"caption":"Wolfgang Ewald"},"logo":{"@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png"}}]}},"_links":{"self":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/15378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/comments?post=15378"}],"version-history":[{"count":8,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/15378\/revisions"}],"predecessor-version":[{"id":23064,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/15378\/revisions\/23064"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media\/8006"}],"wp:attachment":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media?parent=15378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/categories?post=15378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/tags?post=15378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}