Fits nicely on a breadboard.
I followed this guide to get it working with the Arduino IDE: http://highlowtech.org/?p=1695
I downloaded the 64bit Linux 1.6.5-r5 version of the IDE, extracted it to a folder in my home directory. This newer version has the extra board support! I also put the ATtiny ide files in the sketchbook folder under "hardware". See the guide above.
When uploading, it tries to use its built-in avrdude (failing and complaining), but since I have the latest and greatest (6.1) in my /usr/bin, I (moved and) replaced it with a simlink to my system avrdude. Then I loaded up Blink to test on "Pin 0", and wala, we have a blinking tardis:
A TARDIS working. It's totally bigger on the inside. |
I can use the power from my USBmicroISP (power jumper installed) to give it 5V. Very nice.
Sometimes the programming wouldn't initiate. I found that I had to close the IDE, unplug the USBmicroISP, then replug it in, and restart IDE. Then I had no problem changing the fuse settings ("burning the bootloader") to increase the internal clock to 8MHz, and reprogramming Blink. So far so good!
ATtiny85 Arduino IDE pinouts reference |
ATtiny datasheet pinout |
Hex Madness
A friend had asked me about using the hex file from the IDE to upload with avrdude. I wasn't totally sure, given the bootloader needs. Well, it works great! Here's what I did:- Make sure your programmer can see your ATtiny.
$ avrdude -c usbtiny -p t85
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e930b
avrdude: safemode: Fuses OK (E:FF, H:DF, L:E2)
avrdude done. Thank you. - Make sure the fuse bits are set correctly. If not, use the IDE to "burn the bootloader". Usually you only have to do this to change the clock to 8MHz.
- Verify a sketch you want to upload in the IDE, which does the build and outputs a hex file (among other things).
- Find the hex file in the build directory. On my Linux machine it is in "/tmp/build<lots-of-random-#'s>.tmp" It is usually called <Project-name>.cpp.hex. On Windows it is under "Documents and Settings\<user>\Local Settings\Temp" or something similar.
- Fire up the command line again.
$ avrdude -c usbtiny -p t85 -U flash:w:/tmp/build6237348845015981915.tmp/Breathe.cpp.hex:i
-c is the programmer
-p is the part, attiny85
-U is memory operation (flash : write : <hex-file-location> : intel hex file format)
Now we are free to update the firmware with just avrdude and the hex file!
~JWilly
Comments
Post a Comment