Home‎ > ‎DroidBuilders Blog‎ > ‎

Sometimes interesting things come from mistakes...

posted Aug 16, 2012, 6:08 PM by Galen Raben   [ updated Aug 16, 2012, 8:35 PM ]
August 16, 2012:

Some time ago (last year), I ran out of TTS256 chips and I already had some ordered from one of my vendors but they were on back order, and I had orders coming in and no parts to send out in my SpeakJet Shield kits. So I ordered some from another of my vendors who had them in stock. Four days later the package arrived, but lo and behold they were the wrong parts! Instead of the 28 pin TTS256 IC's I was expecting I had gotten a package containing some 8 pin parts labelled ATTINY8520PU. A quick email to the vendor quickly got a reply telling me a new package was in the mail and that I could keep the parts they had sent to me in error. So the package of 8 pin ATTiny parts ended up in my "junk box" (every good electronics hobbyist has one right? I couldn't get by without mine!).

Another thing I often do is when I'm browsing around the Internet and happen on something interesting - I'll save the link, thinking maybe someday I will have a little time to take a better look (as you might guess my bookmarks menu list is HUGE). To make this long story shorter, lets just say a few days ago I was digging in my "junk box" looking for something else and ran across the package of 8-pin ATTiny parts. I then remembered a hi/lo tech article link I had saved and connected the two!

Okay cool... lets see if I can load the Arduino bootloader onto these ATTiny parts! After downloading the damellis-attiny configuration file from the article and adding it into my Arduino 1.0.1 hardware folder, I first tried wiring my Arduino Diecimila as an ISP programmer, but for whatever reason I couldn't get the timing to work and the bootloader download would fail. Then I recalled ordering a USBtinyISP AVR programmer from Adafruit awhile ago for another project (more on that one shortly - yet another story!). So a quick look at this Arduino cheat sheet revealed the connections I needed to make between the programmer and the ATTiny85 chips. Below is a photo of my setup - the ATTiny85 I'm programming is on the left, my USBtinyISP programmer is the black box thing on the right (you can click on the photo for a larger version):

I loaded the Arduino 1.0.1 IDE up, in the "Tools" menu, set the "Board" type to "ATTiny85 (internal 8 MHZ clock)", set the "Serial Port" to my port (which on my PC is 8 for the USBtinyISP programmer), set the "Programmer" to "ATtinyISP" and clicked on "Burn Bootloader". A few moments later saw the "completed" message. Awesome! I then loaded the "Blink" example into the Arduino IDE, modified the "int led = 13;" line to "int led = 0;" for the ATTiny chip (this turns out to be on pin 5 of the IC). Connected an LED and a 1K resistor to the ATTiny chip, then uploaded my sketch to the chip using the USBtinyISP programmer. Success! I now had a blinking LED! Very cool, I now have a little 8-pin Arduino in my hands! This was almost too easy! In the photo above you will note I have two more chips sitting on the end of my protoboard. I soon repeated the bootloader and sketch downloads to these two chips to be sure it was really going to be this easy (I'm paranoid that way - I've had too many things go wrong after having an "easy" success to believe what I see at the first try).

Anyway; I have these little 8-pin Arduino's to play with. Perhaps an Arduino Mini-Sumo robot might be a future kit? These chips only have 8 pins which means you have 6 pins available for I/O (after subtracting 2 pins for +5V and ground). Still though, there are lots of little projects these could be used for! Another nice thing is the ATTiny85 chips are really inexpensive too! And no additional support circuitry is needed - all you need is a +5V power supply and an ISP programmer to load code into them.

Now for my other story... The reason I had the USBtinyISP programmer was for another project I had started last fall for my (then) wifes' birthday. My ex-wife loves horses and I had bought her a programmable LED belt kit to put on her horse for parades. The kit came with Adafruits Atmega32u4 breakout board that, as I later found out, had issues with the (then) new Arduino Leonardo bootloader. I couldn't get the Leonardo USB driver to load into my WinXP desktop PC. After a quick email to Limore at Adafruit, I found out that I needed to re-burn the bootloader into the breakout board. Thus, I ended up purchasing their USBtinyISP AVR programmer. After some (lengthy) time passed I eventually dug out the LED belt kit and the Atmega32u4 breakout and downloaded a new Leonardo bootloader into the Atmege32u4 breakout board using the USBtinyISP programmer. After doing that, the Leonardo USB driver loaded successfully into my desktop PC. I was now able to load some cool programmable LED sequences into the LED belt kit via the breakouts USB. Very cool! My ex still hates me though... Ah well; that is my life I guess.

Some photos of the USBtinyISP programmer kit and my Atmega32u4 Leonardo below (just for fun!)...

Adafruits USBtinyISP programmer kit before assembly:

Adafruits Atmega32u4 breakout board (essentially a small Leonardo clone) - I placed a ruler and a U.S. penny into the photo to give you an idea of the size of this thing! Note the ISP header I added to the bottom of the breakout board to program in the new bootloader:

Note: This breakout works very well with the Arduino 1.0.1 Leonardo bootloader installed. I may have to get a few more of these... :-)