3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Flickering LED Candle

Step 4Program your chip

Program your chip
We'll be cutting off the unused pins of the ATtiny13, so be sure to program the chip before you do that! I use a USBtinyISP programmer and a SparkFun breakout board in a solderless breadboard. We're using the internal oscillator of the tiny13, so there's no need to burn any of the programming fuses. You can use the hex file provided or compile your own with the provided source code.

Some notes about the source code: I used a generic random number generator because the stdlib rand() function is almost twice as large. When you only have 1024 bytes of Flash memory, every byte counts! Also, the millisecond timer doesn't seem to line up with real wall-clock time. But since exact timing isn't really important in this application, I just eyeballed the timing. Purists might cringe, but I'm a pragmatist. :)

To program using the supplied hex file on a Linux system, use this command line:

avrdude -p attiny13 -P usb -c usbtiny -U flash:w:flicker.hex

WinAVR users will probably know the right incantation. I don't do Windows. :D

Update: flicker2.zip contains the second version of the code, featuring two flicker patterns (flicker-up and flicker-down), along with adding watchdog protection to reset the chip if the mainline code should freeze.
« Previous StepDownload PDFView All StepsNext Step »
1 comment
Mar 26, 2010. 4:03 PMtrainables says:
Step 4, learn Latin.  (Sorry, I don't know Latin well enough to teach you.)

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1
Followers
1
Author:SolidSilver