Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

One Second Time Base

Status
Not open for further replies.

jack0987

Member
To create a one second time base, I went looking for this:

Maxim DS32.768 kHz TCXO oscillator

I did not find it exactly, but what I did find is listed as obsolete and I nearly fell over with the price of about $113.00.

After reading a bit to understand how these things work, I was thinking I could use another 32.768KHZ
oscillator except they are about 3 volts and not 5.

Can I use the 3 volt type in a five volt circuit?
 
The simplist way I know of is to use a CD4521 and a 4.194304MHz crystal.
**broken link removed**

EDIT:
I've just read the datasheet cfor the CD4521 and it only has a maximum frequency of 2MHz with a supply voltage of 5V, for 4.2MHz you'll need to power it off at least 9V.
 
Last edited:
Thanks.

I think I will leave modifing a quartz clock timer for another day.
Is there a way to bring your circuit down to 5 volts?

How about this datasheet? Is this a different 4521?
https://www.electro-tech-online.com/custompdfs/2010/05/hef4521b.pdf

Could I just not purchase an oscillator?

I found the attached circuit on the web.
 

Attachments

  • 2Hzclock_731.jpg
    2Hzclock_731.jpg
    10.9 KB · Views: 2,101
Last edited:
Thanks.

I think I will leave modifing a quartz clock timer for another day.
Is there a way to bring your circuit down to 5 volts?

How about this datasheet? Is this a different 4521?
https://www.electro-tech-online.com/custompdfs/2010/05/hef4521b-1.pdf
That looks like an improved version which will work at 5V in the circuit I posted previously.

Could I just not purchase an oscillator?
I haven't seen a ready made 1Hz oscillator on the market.

I found the attached circuit on the web.
I've seen that before, it will work but the frequency is 2Hz, if you want 1Hz, you'll need a divide by two counter which means adding another IC.

The HEF4521 and 4,194,304Hz crystal seem like the most compact and simple option to me.
 
I agree and would like to use your suggested circuit.
Due to the low resolution of web images, I can not make out the text very well.
Could you please post the component values?
 
I agree and would like to use your suggested circuit.
Due to the low resolution of web images, I can not make out the text very well.
Could you please post the component values?

I've neatened it up for you.
 

Attachments

  • 1Hz timebase.PNG
    1Hz timebase.PNG
    3.3 KB · Views: 8,106
How accurate do you need the timebase? The Maxim part is expensive because it is Temperature Compensated, so it has circuitry that is probably individually calibrated at several temperatures. That lets the circuit compensate for the temperature drift of the crystal, resulting in an oscillator that is far more accurate than a standard watch crystal.

A well adjusted watch crystal is accurate enough for most applications. Good for about +/- 50 ppm over 0 - 50 deg C.

If that's not good enough, a high frequency crystal can be more accurate if the temperature range is wide. Can be as good as +/-10 ppm over -10 to + 60 deg C

Then there are TCXOs (temperature compensated crystal oscillators). Price depends on stability, and can be as good as 0.1 ppm over -10 to + 60 deg C

If money is no object and you have plenty of power, there are Oven oscillators ($200 and 5 W) that will give you 0.01 ppm.

That's cheap and low power compared to a Rubidium oscillator.

Or you can use an external source. Most GPS receivers can give a 1 pulse per second output that is seriously accurate as it comes from the frequency standards in the satellites. You can also just divide the mains input by 50 or 60 to give you a 1 second pulse. That is fairly inaccurate in the short term, but is corrected so that the long-term drift is zero, as many electric clocks use the mains frequency as a reference.
 
Thanks Diver300. Your information is very interesting.

As a beginner, reasonable accuracy is good enough for now.
I could have used 60hz from the mains, but wanted to be independent of an external source.
I can breadboard other dividers to the circuit, etc., to learn.

Back to Hero999:
How do I know I am getting the newest, improved version of the 4521?
I looked it up on Mouser, but their datasheet is dated many years ago. Maybe they did not update their datasheet.
 
Hi there Jack,


I would like to ask you an important question, but i'll save that for later.

Just to note, you can use a PIC microcontroller and crystal for super accuracy or use the internal RC oscillator (for about 1% accuracy) and program in some simple code to generate a very simple 1Hz oscillator. If you dont have a PIC programmer, get one (just kidding) or ask someone to program a chip for you for the cost of the chip (about $2 USD). If you use the internal RC oscillator, you dont even need a crystal or external oscillator. The program to do this is SUPER simple and very short too. If the code is adjusted for the particular RC oscillator on chip, the accuracy can be very very good and be stable at room temperature too with only a tiny variation for plus and minus say 10 degrees C.

Not everyone likes or wants to use microcontrollers and i understand this, so another solution is to use an LM339 and a capacitor and a few resistors to make a 1Hz oscillator. It's a very simple circuit and is not too sensitive to voltage variations, and accuracy can be adjusted to very very close to perfect if you have a frequency counter available. It depends on how much accuracy you really need.

Another solution is a 32.768kHz crystal oscillator, CD4020 chip, and 74LS161, that makes up an oscillator/divider to get 1Hz out but yes it takes three dip packages. I've actually used this solution though and it isnt too hard to build, and a high accuracy oscillator can be found if needed.

Recap:
1. LM339 oscillator is the simplest and cheapest (1 cap, four resistors and maybe a potentiometer for perfect adjustment)
2. uC, like the PIC type, very simple but you need a programmer or someone to program one for you.
3. 32.768kHz osc + CD4020 + 74LS161 (or similar), not too hard to build and fairly cheap.
4. CD4521 + osc (Hero's solution), very simple if you can find a C4521 that works up to 4.2MHz at 5v.

Ok, now for the important question:
Are you really after a 1Hz oscillator, or a 0.5Hz (one-half Hertz) oscillator?
The reason i ask is because many times a person is looking for a one half Hertz oscillator but they ask for a 1Hz oscillator. The difference is, if the oscillator is going to be used as a 1Hz time base for say a frequency counter, the frequency really needs to be one half Hertz, not 1Hz, because the period of time the 1Hz wave is high is only one have second and they really want 1 full second. The solution there is to use a 50 percent duty cycle one-half Hertz oscillator.
Of course this may not apply to your application, but i thought i would ask just in case. No problem if you dont really need this.
 
Last edited:
I'm pretty sure the CD4060 is a single chip solution for the 32kHz osc + 1Hz output.
 
Back to Hero999:
How do I know I am getting the newest, improved version of the 4521?
I looked it up on Mouser, but their datasheet is dated many years ago. Maybe they did not update their datasheet.
The datasheet you posted is for the HEF4521, the datasheet I found using Google was for the CD4521
**broken link removed**

Make sure it's the HEF version and it should be fine.

Are you really after a 1Hz oscillator, or a 0.5Hz (one-half Hertz) oscillator?
The reason i ask is because many times a person is looking for a one half Hertz oscillator but they ask for a 1Hz oscillator. The difference is, if the oscillator is going to be used as a 1Hz time base for say a frequency counter, the frequency really needs to be one half Hertz, not 1Hz, because the period of time the 1Hz wave is high is only one have second and they really want 1 full second. The solution there is to use a 50 percent duty cycle one-half Hertz oscillator.
Of course this may not apply to your application, but i thought i would ask just in case. No problem if you dont really need this.
The circuit I posted also has 0.5Hz and 2Hz outputs.

I'm pretty sure the CD4060 is a single chip solution for the 32kHz osc + 1Hz output.
No, it's 2Hz only, to get 1Hz you need another divider.

As far as I'm aware, the 4521 + 4,194,304Hz crystal is the only cheap single IC 1Hz solution but I could be wrong.
 
Last edited:
I'm pretty sure the CD4060 is a single chip solution for the 32kHz osc + 1Hz output.

If you use a HCF4013 Flip Flop connected to Q14 you get 1Hz. Oscillator frequency 32.768KHz/16385=2Hz.

Boncuk
 

Attachments

  • 1Hz-TIMEBASE.gif
    1Hz-TIMEBASE.gif
    12.5 KB · Views: 2,512
The datasheet you posted is for the HEF4521, the datasheet I found using Google was for the CD4521
**broken link removed**

Make sure it's the HEF version and it should be fine.


The circuit I posted also has 0.5Hz and 2Hz outputs.


No, it's 2Hz only, to get 1Hz you need another divider.

As far as I'm aware, the 4521 + 4,194,304Hz crystal is the only cheap single IC 1Hz solution but I could be wrong.


Hi there Hero,

Well, what about the LM339 (or LM393 even) solution, or about the uC solution?
Both are one 8 pin chip solutions right?

In fact, the uC solution can be a single 8 pin chip with no other parts and the user can choose either 3.3v or 5v operation. There may even be 6 pin chip solutions here. Multiple frequencies out if desired.
 
Last edited:
MrAl:

I have several pics and a programmer and am somewhat aware of it's possibilities in this case.
(After a bit of a learning curve, I got it to alternately blink two leds and was so happy I let it run for an hour. )
I am a fair assembly and c programmer, but very low level when it comes to circuits and components.
The pic stuff is something I will be working on in the future.

I like Hero's suggestion because, if I understand correctly, it is most likely as accurate as any watch oscillator and simple to build without the need of additional equipment such as a frequency counter (which I do not have) for calibration. (I do have a good scope once I learn to use it. Calibrate with that maybe?)

However, I think your LM339 suggestion bears serious looking at because the datasheet says it will operate over the full military temperature range. If we combine that with some divider ics, if again I understand correctly, we could have an oscilator that will rival the expensive TCXO for a lot, lot less.

PS: I do want one pulse per second.
 
Last edited:
Hi Jack,


You have a PIC programmer???????????
Then i have to ask, why the problem? Program a PIC with a software counter to count up high enough to take up one instruction cycle less than 1/2 second and then set an output pin high, then count again and set the pin low, then repeat. It's gotta be one of the simplest programs you can do.
If you have an 8 pin PIC laying around you're all set to go...nothing to buy.
 
I assumed he wanted timekeeping accuracy so that would rule out the LM393 which has an accuracy of 10% or worse.

The MCU is still an option but it would need a crystal so the counter might be more convenient.
 
With a 12F508 and a 32768Hz watch crystal you could have a pretty accurate 1Hz timebase. You just copy timer0 bit 7 to an output pin (with a 256 prescaler).

Edit, if you need the code just ask. There are lot's of posters here who could supply it.

Mike.
 
Last edited:
As colin55 said in post #2, just use the 1HZ output from a 1.5Vbattery desk/wall clock. Cheap, easy, and accurate.

Ken
 

Attachments

  • 1 Sec Clock.jpg
    1 Sec Clock.jpg
    76.8 KB · Views: 787
  • 1 Second Clock.gif
    1 Second Clock.gif
    13.3 KB · Views: 2,567
Last edited:
I can not help but smile. This is where my inexpierence shows.
I was thinking the pic may not be accurate enough and failed to realize that it could simply serve as a counter running off a crystal.
Heck, I could even tweak the count to adjust it's accuracy I'll bet.

I have a PIC16F628 already breadboarded with a 4MHZ crystal. Could test it out with that. Be only a matter, I should think, of adjusting the count in the code.

So, sure, if someone would like to post a link for a tutorial or sample generic code of their favorite one for this (C language please.), please do.
I will do a search on this site and google as well.

(I have the Hi-Tech C compiler student edition)
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top