214Views11Replies

Author Options:

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

Picture of

i made a binary clock from an instructable on this site: https://www.instructables.com/id/Binary-Marble-Clock/ 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...

20 Replies

user
steveastroukBest Answer (author)2009-09-13

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.

Select as Best AnswerUndo Best Answer

user
godofal (author)steveastrouk2009-09-14

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?

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)godofal2009-09-14

An Oscilloscope is absolutely THE most important tool for Electronics work.
http://en.wikipedia.org/wiki/Oscilloscope

Select as Best AnswerUndo Best Answer

user
godofal (author)2009-09-19

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...

Select as Best AnswerUndo Best Answer

user
godofal (author)godofal2009-09-19

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...

Select as Best AnswerUndo Best Answer

user
godofal (author)godofal2009-09-19

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...

Select as Best AnswerUndo Best Answer

user
godofal (author)godofal2009-09-20

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)

Select as Best AnswerUndo Best Answer

user
godofal (author)2009-09-18

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!

Select as Best AnswerUndo Best Answer

user
godofal (author)godofal2009-09-18

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!

Select as Best AnswerUndo Best Answer

user
godofal (author)2009-09-14

i did, but the instructable is pretty old, so i have no idea if he/she is still coming online at instructables.com

Select as Best AnswerUndo Best Answer

user
Re-design (author)godofal2009-09-14

If he's still got the same email address the robot will send him an email that he has a comment.

Select as Best AnswerUndo Best Answer

user
godofal (author)Re-design2009-09-18

hmm.. maybe... but i guess this is faster....

Select as Best AnswerUndo Best Answer

user
godofal (author)2009-09-15

k, what programmer/uploader do you use? maybe i can download it...

Select as Best AnswerUndo Best Answer

user
godofal (author)2009-09-15

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?

Select as Best AnswerUndo Best Answer

user
godofal (author)2009-09-14

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?

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)godofal2009-09-14

See if you can borrow one off anybody ? friend, school college, local garage whatever.....

Select as Best AnswerUndo Best Answer

user
godofal (author)2009-09-14

i loaded the .C file into programmers notepad, and hit tools>program.

Select as Best AnswerUndo Best Answer

user
orksecurity (author)2009-09-13

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.

Select as Best AnswerUndo Best Answer

user
godofal (author)orksecurity2009-09-14

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...

Select as Best AnswerUndo Best Answer

user
godofal (author)2009-09-13

the instructable says 10MHZ, thats what i used...

Select as Best AnswerUndo Best Answer