Arduino Forum

Using Arduino => General Electronics => Topic started by: baum on May 24, 2011, 02:33 am

Title: 1hz clock
Post by: baum on May 24, 2011, 02:33 am
I am thinking about making a no-microcontroller clock/timer/stopwatch (74 series ICs only + passive components, preferably). To make it as simple as possible I want to have a 1Hz clock as the basis for the system. Any ideas on how to get an accurate 1Hz clock?
I was thinking of either using a 555 timer (is that accurate enough, though?) or a 32.768kHz crystal w/ a frequency divider.


Any thoughts?

Thanks!
baum
Title: Re: 1hz clock
Post by: baum on May 24, 2011, 02:55 am
But that looks like a 14-stage divider...
32.768kHz/2^14 = 2Hz!
Title: Re: 1hz clock
Post by: RuggedCircuits on May 24, 2011, 02:56 am
Forget the 555 -- it will be subject to the tolerances of the components around it which will never be good enough.

You could use the 60 Hz AC line frequency passed through high-value resistors and some other discretes to generate a pulse every 1/60 of a second, then divide that down to 1 second. Fewer divide stages than 32.768 kHz but slightly more complicated division circuitry.

--
Beat707 (http://www.beat707.com): MIDI drum machine / sequencer / groove-box for Arduino
Title: Re: 1hz clock
Post by: baum on May 24, 2011, 02:58 am
I'd rather not... I'd also like it to be standalone, powered off a 9V battery perhaps?
Title: Re: 1hz clock
Post by: floresta on May 24, 2011, 03:11 am
Quote
I am thinking about making a no-microcontroller clock/timer/stopwatch (74 series ICs only + passive components, preferably). To make it as simple as possible I want to have a 1Hz clock as the basis for the system. Any ideas on how to get an accurate 1Hz clock?


I designed one of these about 30 years ago to drive an old 'International' (now IBM) schoolhouse/railroad clock.  It's still in use in the next room.  All of the documentation is in disk, on state of the art 8" double-sided double-density floppy disks.  I suppose I could go down to the garage and dig out my S-100 computer and hope the mice haven't torn the wires out of it or eaten the boot disk.  I'll look around and see if I can find any printed documentation.  As I recall there was a crystal oscillator that used a 'color-burst' crystal (this was before the days of 32 KHz watch crystals) and a chain of 7490's (it was also before the days of inexpensive cmos).

Don
Title: Re: 1hz clock
Post by: floresta on May 24, 2011, 03:15 am
Quote
The logical and high-tech solution would be to simply use an RTC which has a precision 1Hz output!


That was my thought as well.  You would have to program it to start the oscillator and enable the 1Hz output - not a big deal.

Don
Title: Re: 1hz clock
Post by: baum on May 24, 2011, 03:41 am
Quote
The logical and high-tech solution would be to simply use an RTC which has a precision 1Hz output!  Or, you could use a receiver for the time signal radio service wherever you are on the planet.  Is there some reason you don't even reveal which continent you are on?



1. I was thinking of an RTC, but that would be sort of cheating and an oxymoron. (and expensive) (A very precise clock to drive a homemade not-so-precise clock?)

2. US of A. I don't want the radio. I think I have decided on a crystal.


How about this, though?:

Send the 32.768kHz to a 12 bit counter, now we have 32,768/2^12 = 8. Then get a decade counter, and tie 'Q7 to reset. Then, when counter reaches 8th output, it "overflows." Would this give me a fairly precise 1Hz clock?
Title: Re: 1hz clock
Post by: CrossRoads on May 24, 2011, 04:28 am
If you have a 12 bit counter, why not go all the way to 15?
http://focus.ti.com/lit/ds/scls704a/scls704a.pdf

Line frequency is not that accurate - I have Bose CD clock radio that is always gaining time because it runs from line frequency.  Great sound, always fast.
Title: Re: 1hz clock
Post by: CrossRoads on May 24, 2011, 07:56 am
Whenever I put a multimeter frequency counter on the mains here, it has always come back fast,  you can see it doing a slow drift between 60Hz up to about 62.5 if I recall.
Title: Re: 1hz clock
Post by: tastewar on May 24, 2011, 02:47 pm

Quote
Line frequency is not that accurate

For the purposes of long-term time accuracy, power mains frequency is just as accurate as the NITS Atomic Clock. Because all the utility companies maintain the grid frequency against WWV.


Yeah that 'NITS' atomic clock isn't all it's hyped up to be ;-)

To satisfy my curiosity (which you're obviously under no obligation to do...), can you point to something that documents this? Oh wait, here it is: http://en.wikipedia.org/wiki/Utility_frequency#Long-term_stability_and_clock_synchronization (http://en.wikipedia.org/wiki/Utility_frequency#Long-term_stability_and_clock_synchronization)
Title: Re: 1hz clock
Post by: baum on May 24, 2011, 10:47 pm
Quote
If you have a 12 bit counter, why not go all the way to 15?
http://focus.ti.com/lit/ds/scls704a/scls704a.pdf


Digikey (where I'm buying from) only sells minimum 880. How about a cheaper 14-bit unit with a toggle (2-bit) connected to the output? 2^14*2 = 32.768kHz.
Title: Re: 1hz clock
Post by: justjed on May 25, 2011, 12:37 am

Yeah that 'NITS' atomic clock isn't all it's hyped up to be ;-)


The Knights of NI have a Time Service?

What is the average hz of an unladen swallow's wingbeat? :smiley-mr-green:
Title: Re: 1hz clock
Post by: baum on May 25, 2011, 12:54 am
But eight dual flip flops would be 16 flip flops total... 2^16 = 65536. I'm looking for 2^15. If I use seven dual flip flops, what should I use to take the frequency from 2hz to 1hz?
Title: Re: 1hz clock
Post by: baum on May 25, 2011, 02:07 am

Doh! :P

I just hit my self in the head b/c I realized I am being WAY to harsh on myself. I'll just use a 65.536kHz crystal and use a dual 8-bit (16 bits total) binary counter to bring it down to 1 hz.

Thanks for all the help!
Title: Re: 1hz clock
Post by: baum on May 25, 2011, 02:28 am
OK. So I found the 74HC590. This is an 8-bit counter, right? So if I daisy-chain 2 of these, I should get the 65.536kHz crystal down to 1Hz?
Title: Re: 1hz clock
Post by: mattcf on May 25, 2011, 04:43 am
an ATtiny and an external 8 or 16 Mhz crystal could do it (Set it up to pulse every second)
Title: Re: 1hz clock
Post by: baum on May 25, 2011, 09:09 pm
I am going to end this topic and start a new, more specific one. Thanks for all the help!
Title: Re: 1hz clock
Post by: CrossRoads on May 25, 2011, 10:16 pm
Yes,
Feed 64 KHz into CCLK, RCO from stage 1 into stage 2, RCO Pulse from will yield a low going pulse 1/64K wide 1x a second.

http://www.eetkorea.com/ARTICLES/2001SEP/2001SEP06_AMD_AN.PDF
See figure 3 for suggestion on getting 64KHz source. Other ways also possible, this seems pretty straight forward.
http://www.z80.info/uexosc.htm
Title: Re: 1hz clock
Post by: baum on May 25, 2011, 11:42 pm
Quote
seems pretty straight forward.


Not as easy as I would have hoped, but I guess it will be fine. For the first link, they don't specify where the output is...any ideas?

Also, is there a way I can get 50% duty cycle?
Title: Re: 1hz clock
Post by: CrossRoads on May 26, 2011, 03:56 am
Enable the outputs, and use the MSB, which will change hi/lo/hi/lo every 1/2 second.
Title: Re: 1hz clock
Post by: baum on May 26, 2011, 10:42 pm
right...

how exactly do I setup the crystal though?
Title: Re: 1hz clock
Post by: baum on May 26, 2011, 11:36 pm
I want to connect the 65.536kHz crystal to the clock of a binary counter. no microcontrollers involved.
Thanks!
Title: Re: 1hz clock
Post by: CrossRoads on May 27, 2011, 02:22 am
Reply #24 has circuits to make the 64K oscillator that will drive the clock line.
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 02:26 am
But which would should I use? There are three on that page.
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 02:44 am
My counter chip is a 74393, i will be running the power supply at 3V (2x AA) and I will be using this (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=XC975-ND) crystal.
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 02:56 am
Whoops. Then how about 3x AA, which would be 4.5V?
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 03:28 am
Whops again.... I meant to say 74HC393. :( Sorry for the confusion!
Title: Re: 1hz clock
Post by: CrossRoads on May 27, 2011, 09:13 pm
Try the simplest one first baum, if that works then you're all set.
If not, try another.
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 09:14 pm
So the second one w/ 3 inverters and a 100N cap?
Title: Re: 1hz clock
Post by: CrossRoads on May 27, 2011, 09:19 pm
I would have suggested Figure 3 from this link first
http://www.eetkorea.com/ARTICLES/2001SEP/2001SEP06_AMD_AN.PDF
1 inverter, couple of 22pF caps, couple of resistors.
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 09:22 pm
But where do I get my frequency output from? I would prefer that one, though.

Thanks a lot!
baum
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 09:39 pm
OK. and they mention a range for Rf, but for R1 they say it = XC1. What does this mean? Is it the frequency times C1 (which would be 22pf for me)? In that case R1=65,536*2.2E-11= 1.441792x10^-6?!!!!

Help!
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 10:17 pm
I see you attached a picture of some oscillators, but these only come in frequencies higher than 1Mhz... I'll try these suggestions when the parts come.


Thanks!
baum
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 11:02 pm
But I would need a power of 2 for it to work out. Digikey doesn't have any powers of two oscillators (2^20, 2^21, 2^22, etc.).
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 11:21 pm
Excellent! THANK YOU SO MUCH!!!!! But I can use 4.5V (3x AA) still, right?

Also, the crystal datasheet says 12.5pF load capacitance. Should I change that, or leave it how you have it?


Thanks again!
baum

p.s. you are right about digikey, but they generally tend to be the best and easiest for finding obscure components that I can't get at sparkfun or another similar store.
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 11:42 pm
But what about the 100pF cap?

Quote
BTW:  I found that circuit simply by Googling for: 1Hz crystal oscillator

I should be sent back to 1st grade for forgetting that. Idiot.
Title: Re: 1hz clock
Post by: baum on May 27, 2011, 11:48 pm
Can I just use the formulas form one of the documents CrossRoads posted?
Title: Re: 1hz clock
Post by: baum on May 28, 2011, 12:02 am
Quote
underestimating linear circuit design.


What do you mean?

and I will try those formulas some time...
Title: Re: 1hz clock
Post by: baum on May 28, 2011, 12:07 am
Are there any other easier ways of getting a 1Hz square wave with 50% duty cycle?
Title: Re: 1hz clock
Post by: baum on May 28, 2011, 12:22 am
You win. I'll just get the cheapest RTC they have... but I will feel a little cheated, using the sq wave of an RTC to power a clock... :(

Thanks for all the help, everyone. I'll try the oscillators that will oscillate some other time....
Title: Re: 1hz clock
Post by: Showlyshah on May 08, 2016, 11:49 pm
Just a simple idea.. But dont know if it works for you.. U can take a clock cob board from a clock or alarm.. And loop out the coil connections.. And that will give u a 1hz clock. I have used the same with peojects which needed 1hz clock.. U cant get any simpler than that.!!! Or just in 2 dollars... U cant go further cheep!
Title: Re: 1hz clock
Post by: aarg on May 09, 2016, 01:48 am
Just a simple idea.. But dont know if it works for you.. U can take a clock cob board from a clock or alarm.. And loop out the coil connections.. And that will give u a 1hz clock. I have used the same with peojects which needed 1hz clock.. U cant get any simpler than that.!!! Or just in 2 dollars... U cant go further cheep!
Actually, you almost can. RTC modules are down to about US$2 with free shipping now.
Title: Re: 1hz clock
Post by: pwillard on May 09, 2016, 02:15 pm
There used to be a chip for this... now its basically unobtanium.

EBAY (http://www.ebay.co.uk/itm/MM5369-Integrated-Circuit-Case-DIP8-Make-National-Semiconductor-/172141587198?hash=item2814702afe)