{"id":226,"date":"2021-08-15T11:26:33","date_gmt":"2021-08-15T10:26:33","guid":{"rendered":"https:\/\/www.bolukan.nl\/?p=226"},"modified":"2021-08-15T11:31:50","modified_gmt":"2021-08-15T10:31:50","slug":"attiny13a-discovery","status":"publish","type":"post","link":"https:\/\/www.bolukan.nl\/?p=226","title":{"rendered":"ATtiny13a discovery"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" width=\"150\" height=\"150\" class=\"wp-image-227\" style=\"width: 150px;\" src=\"https:\/\/www.bolukan.nl\/wp-content\/uploads\/2021\/08\/U491e2704ca4945baa53b26a1eff5628db.jpg\" alt=\"ATtiny13a\" srcset=\"https:\/\/www.bolukan.nl\/wp-content\/uploads\/2021\/08\/U491e2704ca4945baa53b26a1eff5628db.jpg 800w, https:\/\/www.bolukan.nl\/wp-content\/uploads\/2021\/08\/U491e2704ca4945baa53b26a1eff5628db-300x300.jpg 300w, https:\/\/www.bolukan.nl\/wp-content\/uploads\/2021\/08\/U491e2704ca4945baa53b26a1eff5628db-150x150.jpg 150w, https:\/\/www.bolukan.nl\/wp-content\/uploads\/2021\/08\/U491e2704ca4945baa53b26a1eff5628db-768x768.jpg 768w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The ATtiny13a is a 8-bit AVR MCU featuring 1 KB of ISP Flash, 64B EEPROM and 64B SRAM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To program the ATtiny13a you need to communicate to the device via the SPI interface. Since computers in general don&#8217;t support SPI, I used another MCU as an intermediary, called &#8216;Arduino as ISP&#8217;. I flashed the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/arduino\/arduino-examples\/tree\/main\/examples\/11.ArduinoISP\/ArduinoISP\" data-type=\"URL\" data-id=\"https:\/\/github.com\/arduino\/arduino-examples\/tree\/main\/examples\/11.ArduinoISP\/ArduinoISP\" target=\"_blank\">ArduinoISP.ino<\/a> example code to an ESP8266. This code does not compile on PlatformIO because PlatformIO requires forward defined functions and the example code does not comply.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To support the <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.platformio.org\/en\/latest\/boards\/atmelavr\/attiny13a.html\" data-type=\"URL\" data-id=\"https:\/\/docs.platformio.org\/en\/latest\/boards\/atmelavr\/attiny13a.html\" target=\"_blank\">ATtiny13a<\/a> board in PlatformIO install the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/platformio\/platform-atmelavr\" data-type=\"URL\" data-id=\"https:\/\/github.com\/platformio\/platform-atmelavr\" target=\"_blank\">Atmel AVR platform<\/a> which includes <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/MCUdude\/MicroCore\" data-type=\"URL\" data-id=\"https:\/\/github.com\/MCUdude\/MicroCore\" target=\"_blank\">MicroCore<\/a>. The default upload protocol which works with ArduinoISP.ino is named <code>stk500v1<\/code> and is the default protocol for the ATtiny13a.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">platformio.ini:<br><code>[env:attiny13a]<\/code><br><code>platform&nbsp;=&nbsp;atmelavr<\/code><br><code>board&nbsp;=&nbsp;attiny13a<\/code><br><code>framework&nbsp;=&nbsp;arduino<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example code:<br><code>#include&nbsp;&lt;Arduino.h&gt;<\/code><br><code>#define&nbsp;LED_PIN&nbsp;PB3<br>void&nbsp;setup() {<\/code><br><code>&nbsp;&nbsp;pinMode(LED_PIN,&nbsp;OUTPUT);<\/code><br><code>}<br>void&nbsp;loop() {<\/code><br><code>&nbsp;&nbsp;PORTB&nbsp;^=&nbsp;1&nbsp;&lt;&lt;&nbsp;LED_PIN;<\/code><br><code>&nbsp;&nbsp;delay(500);<\/code><br><code>}<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ATtiny13a is a 8-bit AVR MCU featuring 1 KB of ISP Flash, 64B EEPROM and 64B SRAM. To program the ATtiny13a you need to communicate to the device via the SPI interface. Since computers in general don&#8217;t support SPI, I used another MCU as an intermediary, called &#8216;Arduino as ISP&#8217;. I flashed the ArduinoISP.ino [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[7,18,12],"class_list":["post-226","post","type-post","status-publish","format-standard","hentry","category-esp8266","tag-esp8266","tag-mcu","tag-platformio"],"_links":{"self":[{"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=226"}],"version-history":[{"count":3,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/posts\/226\/revisions\/230"}],"wp:attachment":[{"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}