Crystal and Counter for Timebase
dtalvacchio
Posts: 36
Hello-- I'm about to use a variation of the circuit and code from an AppNote in the Basic Stamp Programming Manual (manual is attached; the note is #20: An Accurate Timebase, pg. 97 of the PDF). It uses a 32,768 crystal and a 4060 counter to produce a 2-Hz signal, which the code then converts to a one-cycle-per-second heartbeat for the clock.
The only difference for me is: instead of using the counter and code to divide the 32,768-Hz signal to a 1-Hz signal, I'll only want to divide it down to an 8-Hz signal for my application. This part I believe I can handle.
What I am hoping for is a little help with the circuit. I see that I need to use two resistors and two capacitors but: (1) I'm not sure what function they are serving, and so (2) I don't know how to find the right values for these components. Will the pulse be inaccurate if I don't find the appropriate values? Is it mainly a matter of trial and error? If so, in which direction would I correct if I saw that the clock was gaining or losing time? Any theoretical explanation would be greatly appreciated, so that I'll know how to get started.
I'm very much a newbie, so please be gentle.
Thanks!
The only difference for me is: instead of using the counter and code to divide the 32,768-Hz signal to a 1-Hz signal, I'll only want to divide it down to an 8-Hz signal for my application. This part I believe I can handle.
What I am hoping for is a little help with the circuit. I see that I need to use two resistors and two capacitors but: (1) I'm not sure what function they are serving, and so (2) I don't know how to find the right values for these components. Will the pulse be inaccurate if I don't find the appropriate values? Is it mainly a matter of trial and error? If so, in which direction would I correct if I saw that the clock was gaining or losing time? Any theoretical explanation would be greatly appreciated, so that I'll know how to get started.
I'm very much a newbie, so please be gentle.
Thanks!
pdf
516K
Comments
· Here are some programs and notes I have for the 4060 as a pulse generator. The EXE file is a qbasic program which will caculate your xtal needs for any freq.
Larry
·· Did you see the second file, The PDF file is shows all you need for hook up
If you use the adjustable cap setup how will you be checking for freq do you have a scope or will you be using count or pulsin for this.
If this is the case then use the 17pf or 19pf caps and let it run. I’m not sure the count command or looking at a clock will show any difference. But! why don't you try some different cap sizes and let us know what the count command shows. I would be interested to see the difference
cgi.ebay.com/10pcs-500V-17PF-Dipped-Silver-Mica-Capacitors-NEW_W0QQitemZ3870616717QQihZ017QQcategoryZ36336QQssPageNameZWD1VQQrdZ1QQcmdZViewItem
but they're not ceramic and the voltage rating is very high. Does this matter?
Nothing ventured, nothing gained.
Give it a shot, it isn't that critical, it's capacitance, not critical mass.
·[noparse]:)[/noparse]
···· http://www.jameco.com/Jameco/catalogs/c262/P72.pdf
http://www.jameco.com/webapp/wcs/stores/servlet/CategoryDisplay?storeId=10001&catalogId=10001&langId=-1&categoryId=203030
THIS is the circuit drawing from the PDF youreferenced on the original post --
There is a 33pF fixed cap and a 33pF variable, and a·10M and a 220K resistors.· If you go using odd-ball values then·you're off the reservation and all bets are off.
The variable is for frequency adjustment, it's for slight variation not broad variation.
If you want anything other than the 2Hz in the experiment, then you'll have to use the other output IC pins (4060).· I believe somebody posted a table previously.· I have not read that.
N.B. -- The output on pin 3 is the input freq/16,000 = 2.048.· The output on pin 1 is the input freq/4,000 = 8.192· After pulling your hair out, you may find that you can adjust that cap enough to lose the decimal place (it'll drift with temperature, other factors.)
Post Edited (PJ Allen) : 6/26/2006 4:57:54 PM GMT