Getting Started with the ATtiny85 Chip

ATtiny-programmed-Arduino-Uno Those of you that read this blog know that my talents (and education) skews to the mechanical side of “hacking” or “making.”  Given that the IO for many of my projects is fairly simple, the ATtiny could be an ideal programming platform.  This little chip is available from Sparkfun, for under $3.00, or for less if purchased in bulk (Ebay has some).  Although it only has 5 (or possibly 6) IO pins, this little chip is incredibly small, and with such a low cost can easily be left on a project.

Once I got it, I intended to use an Arduino Uno (my review) that I had available to program this board.  To test it out, the “blink” sketch was used as shown in this MIT tutorial.  This is also shown via video in this tutorial by Make’s Matt Richardson.  The information should be the same in each, but when I tried this, it gave me some sort of “USB not found error.”

The trick to fixing this was actually pretty simple.  I’m not sure if it’s because I’m running Ubuntu Linux,** but my Arduino computer software didn’t exactly match up to Matt’s video.  When the new hardware protocols were installed, under tools > board, there was no option for “ATtiny85 (w/Arduino as ISP).”  Instead I had to go to tools > programmer and select “Arduino as ISP.”  After this was done, with the ATtiny hooked up as shown to the right (and in the MIT tutorial), it was able to successfully download the “blink” sketch to the ATtiny chip.

One thing that was a bit of an issue is that the blinking was running very slowly.  I’d selected 8 Mhz, when the chip seems to run by default at 1 Mhz.  It was taking roughly 8 seconds to blink on and off, which I assume had to do with waiting for eight times the number of processor cycles as it should have to represent 1 second.  Once this was changed, everything worked perfectly.  I further experimented with 3 LEDs chasing each other as shown in the video below.  The code for this is also available here, using pins 3, 4, and 0.

This is a simple example, but I’m really looking forward to some neat small projects that I can do with this board.  Having a “disposable” chip will hopefully allow me to keep more of my projects intact!  I would definitely recommend the ATtiny85 for those little projects that may not need a full Arduino, but where a little programmable logic would be nice!

As a bonus, here’s a time-lapse video of me taking apart a somewhat ruined iPod.**  The idea of putting a small chip into this for various hijinks (not yet done) inspired me to look for ways to miniaturize my projects!

*On Ubuntu, you’ll have to install The Aduino IDE using the software center, or it doesn’t seem to work correctly.  If you remove it with the software center, and just run it out of a directory it still works for 1.01 and 1.03.  There may be a better way, but this worked for me.  Be sure to use the file referenced here, as article Matt references seems to be outdated and didn’t work for me.

**This iPod was a Christmas present, and came pre-broken.  A really bad present for most, but my sister knows me well enough to know that this would be a perfect gift (she did get me something else as well).  I “may have” mentioned to her that I wanted it as well.

  1. “ATtiny85 (w/Arduino as IDE). Instead I had to go to tools > programmer and select “Arduino as AVR.”

    Arduino IDE is the Arduino software, that’s not the acronym you’re looking for there.

    AVR is the series of chips most Arduinos run on (all official except the Due). The ATTiny is also an AVR. Again, not the acronym you’re looking for.

    Both should be Arduino as ISP, or in system programmer.

  2. World's Tiniest "Most Useless Machine" Prototype - pingback on April 28, 2013 at 11:18 am
  3. Simple servo control with ATtiny or other microcontroller - pingback on May 21, 2013 at 7:40 am

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks and Pingbacks: