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.

Mini Dotclock

Step 5About the firmware and supercap backup

This firmware was designed with the Sourceboost compiler and uses the Sourceboost I2C library to talk to the RTC chip. I had to modify the i2c driver to use longer delays in order to get reliable operation.
The firmware initialises io, then reads the every ten seconds or so (you can modify this in the code if you want a quicker update or random update times. I found this period to be the least distracting). If keypresses are detected then it goes into the clock time change routine until exited with a press of switch one.

Also in the design is a space for a supercap. I haven't tested this, but installing one should allow the clock to handle power outages for a short period of time.

In the firmware once the RTC data is read, a routine takes the digit values and assigns a random selection of active LEDs to that digit, the same number as the digit value. These are kept in a table. An interrupt routine takes one value out of the table at a time and sends them to the LED driver chips, and an LED is lit (actually two, one per chip). Next entry to the routine gets another and so on. When run fast enough the LEDs active in the table all appear to be lit at the same time. You can change the timing of the interrupt routine to make it faster if you like.

Have fun, and if you build one of these into something cool...send me a picture.
Philip Pulle
www.rgbsunset.com
« Previous StepDownload PDFView All StepsNext Step »

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!
26
Followers
7
Author:rgbphil
update later