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.

Binary Marble Clock

Step 8The software

The software
The software is written in C for the Atmel using GCC.

There are really nothing special about the software. Timer0 is used to generate interrupts every 1638.4 uS and the Bresenham algorithm is used to make sure that the clock ticks at average every second.

After power on the the clock displays a dot that flashed up & down to indicate that the time must be set.

By pressing the button the time advances as a slow rate for 15 seconds and then speeds up. If the button is just pressed momentarily (0.1-0.5 seconds) the time is decremented by one minute for easy adjustment.
« Previous StepDownload PDFView All StepsNext Step »
1 comment
May 11, 2008. 3:46 PMjeff-o says:
Hi Mats, I've got the 20MHz version of the ATtiny2313. I assume I have to change all of the "10000000" references to 20000000, right? Do I have to touch the 1638.4 uS timer0 interrupt or will that take care of itself if the program know what speed it's running at?

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!
12
Followers
10
Author:matseng
Swedish expat living now living in Malaysia after spending some years working in Dubai.