binary clock runs to slow, how do i speed it up?

i made a binary clock from an instructable on this site: but it turns out it runs WAY to slow.
i wanted to know how good it ran, so i made the time 23:29 (current time then) and went to sleep. at 09:45 (not extactly) the clock gave about 00:30
how do i make sure it runs like it should? couse now its being used as a light decoration...

Picture of binary clock runs to slow, how do i speed it up?
sort by: active | newest | oldest
Check the crystal. The code looks sound enough, unless you've recompiled it yourself. If your crystal wiring is off, the thing may be running erratically. Get an oscilloscope and start prodding.
godofal (author)  steveastrouk8 years ago
i did not make any changes to the code/parts, in fact i did exactly what the instructable says... and i think that its not the wiring. what is an oscilloscope? and what does it do?
An Oscilloscope is absolutely THE most important tool for Electronics work.
godofal (author) 8 years ago
not much... i still use PN... but im timing it right now, and so far no minutes (binary clock) have past and im closing in on 3 minutes (stopwatch)... so it didnt work... im just going to do it manually...
godofal (author)  godofal8 years ago
i got it olmost good now! line 65: ticks-=163840;
but it runs about 1 seconds to slow per minute... thats 24 minutes per day... still gotta make that right...
godofal (author)  godofal8 years ago
one question, is there a way to make the program so, that it remembers the last time it was on (like i take the power off at 22:40) and i put it in later, it gives that time? i saw the line of code specifying what time it should start, but i wanted to know this...
godofal (author)  godofal8 years ago
well, its really alot of work :P but i found out a way now... i made a 12 hour timer on my watch, put the binary clock on 12:00 and started exact the same time. turns out that the binary clock runs 26 minutes to slow over a 12 hour cycle. so, thats 26 / 720 to slow, so i did the math, and reprogrammed the attiny, so now it should work (line 65 ticks now has the number: 169756,4444444444444444444444444443 for time :P)
godofal (author) 8 years ago
i think it is indeed the recompiling, i just checked the .hex i got after compiling, and the .hex he gives in the instructables, and there are several differences... so now i just got to load it into the attiny2313, and it should work like a charm!
godofal (author)  godofal8 years ago
well i found out a way to load the correct .hex into the attiny2313 (i think, havent tested with attiny) i deleted the wrong .hex and renamed the right .hex so that he takes that one... hopefully it'l work, im going to try later today, il post if it does!
godofal (author) 8 years ago
i did, but the instructable is pretty old, so i have no idea if he/she is still coming online at
If he's still got the same email address the robot will send him an email that he has a comment.
godofal (author)  Re-design8 years ago
hmm.. maybe... but i guess this is faster....
godofal (author) 8 years ago
k, what programmer/uploader do you use? maybe i can download it...
godofal (author) 8 years ago
i dont think anyone i know is interested enough to have a scope... but il try that changing the code, will probably cost some time to get it really accurate... but first il try to load that hex file he gave me. btw how do i do that?
godofal (author) 8 years ago
well it looks handy, but i dont have 200 bucks to spend on something like that. not yet at least. maybe later, but for now il just use my multimeter :) but again, how should i alter the code?
See if you can borrow one off anybody ? friend, school college, local garage whatever.....
godofal (author) 8 years ago
i loaded the .C file into programmers notepad, and hit tools>program.
orksecurity8 years ago
As others have said: Either the main oscillator is too slow, or you're dividing it down too far, or threre's a bad connection and you aren't getting all the ticks you should. Of course if it's consistently off, the lazy way to fix it would be to recalibrate the code. I agree that asking the author of the 'ible is a Good Idea. There may be a mistake in the instructions which should be fixed, or something not described well that should be clarified.
godofal (author)  orksecurity8 years ago
it looks pretty consistently... what should i alter in the code for the lazy way then? il check the connections, but im 90% sure its not that...
godofal (author) 8 years ago
the instructable says 10MHZ, thats what i used...