Electronics-Related.com
Forums

Dividing a 32768 Hz crystal frequency

Started by John Woodgate June 26, 2023
On 2023-06-26, John Woodgate <jmw28563@gmail.com> wrote:
> On Monday, June 26, 2023 at 4:09:51&#8239;PM UTC+1, John Larkin wrote: >> On Mon, 26 Jun 2023 08:00:44 -0700 (PDT), Lasse Langwadt Christensen >> <lang...@fonz.dk> wrote: >> >> >mandag den 26. juni 2023 kl. 16.20.48 UTC+2 skrev John Woodgate: >> >> I want to divide a 32768 Hz crystal frequency by 20 to get a stable frequency for a component bridge. I could use a 4017 and half a a 4013 (sorry about these ancient devices, but they are still good for some things), but I would have to add something to make the crystal oscillate unless there is a way to use the other half of the 4013 to make the oscillator. >> >> >> >> I also looked at using just a 4096, which gives me the oscillator, but I can't see how to make it divide by 20. I know there is a technique that combines some of the output signals via an EXOR to achieve divisors that are not powers of 2, but I can't find information on which signals to combine. >> > >> >get a 32768 Hz oscillator instead of a crystal, saves alot of headaches >> Yes. Oscillators made from a crystal and a chip and some caps and >> maybe a resistor, tend to not oscillate. And certainly won't be PPMs >> on-frequency, as a purchased oscillator usually is. >> >> Maybe play with the math and use some other oscillator frequency and >> some easy divisor? > I think I'd be very lucky to find a better combination of crystal frequency and division ratio. But if you could suggest a simple way of getting closer to 1591.55 Hz I would be very interested.
1638.4Hz doesn't seem especially close 3% 25.6khz/16 = 1600Hz unfortunately this crystal is out of stock everywhere I looked. 100Khz/64 = 1562.5 can do this with a CD4060 and a crystal 6.5MHz/4096 = 1586.9 maybe possible with a CD4060 but probably need more than 5V and I'm only looking a power of two divisors. -- Jasen. &#127482;&#127462; &#1057;&#1083;&#1072;&#1074;&#1072; &#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1110;
On 26/06/2023 23:54, John Woodgate wrote:
> On Monday, June 26, 2023 at 11:39:14&#8239;PM UTC+1, Phil Hobbs wrote: >> Phil Hobbs <pcdhSpamM...@electrooptical.net> wrote: >>> John Woodgate <jmw2...@gmail.com> wrote: >>>> I want to divide a 32768 Hz crystal frequency by 20 to get a >>>> stable frequency for a component bridge. I could use a 4017 and >>>> half a a 4013 (sorry about these ancient devices, but they are >>>> still good for some things), but I would have to add something >>>> to make the crystal oscillate unless there is a way to use the >>>> other half of the 4013 to make the oscillator. >>>> >>>> I also looked at using just a 4096, which gives me the >>>> oscillator, but I can't see how to make it divide by 20. I know >>>> there is a technique that combines some of the output signals >>>> via an EXOR to achieve divisors that are not powers of 2, but I >>>> can't find information on which signals to combine. >>>> >>> >>> Hey, John, >>> >>> Nice to see you back on SED, man! An HC40103 will do it, if you >>> don&rsquo;t mind a 5% duty cycle. >>> >> Plus a 74HC1G04 or something for the oscillator. Cheers > > Thanks, Phil. I left SED when it turned into a political forum. I > will certainly look at 40103, but the duty cycle is a problem. I want > to filter the output to make a sine wave with not too much > distortion. I don't seem to be able to reply to this group by email.
Depending on how much is not much then for a spot frequency integrating it once and diode shaping followed by a filter will get all the higher harmonics well down. HP patent on this trick is long out of date. I'm curious - what is special about 1591.55 Hz ? To do that you actually want to divide 32768 by (almost) 20.6 which gets 1590.68 or easier 20.5 which gets 1598.44 20 21 alternately and then combine with the original clock signal to get 20.5 20.5 equal mark space ratio at your chosen frequency. 20 21 20 21 20 would get your 20.6 but with terrible phase noise and harmonic content that might well be more problematic to eliminate.
> Is that the way it is set up?
More likely how your news client is set up. Thunderbird has "Reply" (to author) as one of its buttons. Updates sometimes promote it to being the default action too! -- Martin Brown
 John Woodgate wrote:
-------------------------------------
> > I will certainly look at 40103, but the duty cycle is a problem. > I want to filter the output to make a sine wave with not too much distortion.
** How temp stable does the frequency REALLY have to be for your app ?? If 3% away from ideal f is OK - maybe no crystal or ceramic doovey is needed. How about a one ( cheap) IC, linear RC oscillator with near perfect sine output - allows adjustable f to spot on your desired number. Using 1% MF resistors and polystyrene caps, temp stability can be suprisingly good. BTW nice to see you back. ......Phil
On Tuesday, June 27, 2023 at 8:15:58&#8239;AM UTC+1, Martin Brown wrote:
> On 26/06/2023 23:54, John Woodgate wrote: > > On Monday, June 26, 2023 at 11:39:14&#8239;PM UTC+1, Phil Hobbs wrote: > >> Phil Hobbs <pcdhSpamM...@electrooptical.net> wrote: > >>> John Woodgate <jmw2...@gmail.com> wrote: > >>>> I want to divide a 32768 Hz crystal frequency by 20 to get a > >>>> stable frequency for a component bridge. I could use a 4017 and > >>>> half a a 4013 (sorry about these ancient devices, but they are > >>>> still good for some things), but I would have to add something > >>>> to make the crystal oscillate unless there is a way to use the > >>>> other half of the 4013 to make the oscillator. > >>>> > >>>> I also looked at using just a 4096, which gives me the > >>>> oscillator, but I can't see how to make it divide by 20. I know > >>>> there is a technique that combines some of the output signals > >>>> via an EXOR to achieve divisors that are not powers of 2, but I > >>>> can't find information on which signals to combine. > >>>> > >>> > >>> Hey, John, > >>> > >>> Nice to see you back on SED, man! An HC40103 will do it, if you > >>> don&rsquo;t mind a 5% duty cycle. > >>> > >> Plus a 74HC1G04 or something for the oscillator. Cheers > > > > Thanks, Phil. I left SED when it turned into a political forum. I > > will certainly look at 40103, but the duty cycle is a problem. I want > > to filter the output to make a sine wave with not too much > > distortion. I don't seem to be able to reply to this group by email. > Depending on how much is not much then for a spot frequency integrating > it once and diode shaping followed by a filter will get all the higher > harmonics well down. HP patent on this trick is long out of date. > > I'm curious - what is special about 1591.55 Hz ? > > To do that you actually want to divide 32768 by (almost) > 20.6 which gets 1590.68 or easier 20.5 which gets 1598.44 > > 20 21 alternately and then combine with the original clock signal to get > 20.5 20.5 equal mark space ratio at your chosen frequency. > > 20 21 20 21 20 would get your 20.6 but with terrible phase noise and > harmonic content that might well be more problematic to eliminate. > > Is that the way it is set up? > More likely how your news client is set up. > Thunderbird has "Reply" (to author) as one of its buttons. > > Updates sometimes promote it to being the default action too! > > -- > Martin Brown
Thanks, Martin and all the others who have given helpful advice --- too many to reply individually. The project is tutorial in nature, so I don't want to use too many 'integrated' fixes, and SMD-only devices are not an option. Regarding the frequency, it does need to be near 10k/2pi, but other things can be adjusted to suit the exact frequency, which needs to be stable within &plusmn;1% and not require a counter to determine it. I will try 'Reply to list' instead of 'Reply' to see if that works.
On a sunny day (Mon, 26 Jun 2023 23:20:14 -0700 (PDT)) it happened Ricky
<gnuarm.deletethisbit@gmail.com> wrote in
<c49794d7-262f-4006-9b9e-5cc15ed60dd7n@googlegroups.com>:

>On Tuesday, June 27, 2023 at 1:38:44&#8239;AM UTC-4, Jan Panteltje wrote: >> On a sunny day (Tue, 27 Jun 2023 01:20:59 -0000 (UTC)) it happened Mike M= >onett >> VE3BTI <spa...@not.com> wrote in <XnsB02FD9304A...@135.181.20.170>: >> >John Woodgate <jmw2...@gmail.com> wrote: >> > >> >> I want to divide a 32768 Hz crystal frequency by 20 to get a stable >> >> frequency for a component bridge. I could use a 4017 and half a a 4013= > >> >> (sorry about these ancient devices, but they are still good for some= > >> >> things), but I would have to add something to make the crystal oscilla= >te >> >> unless there is a way to use the other half of the 4013 to make the >> >> oscillator. >> >> >> >> I also looked at using just a 4096, which gives me the oscillator, but= > I >> >> can't see how to make it divide by 20. I know there is a technique tha= >t >> >> combines some of the output signals via an EXOR to achieve divisors th= >at >> >> are not powers of 2, but I can't find information on which signals to= > >> >> combine. >> > >> >Tom Van Baak, moderator of the Time-Nuts group, posted an article years = >sgo >> >on using a PIC to count down from 2 to 255. It had very low jitter. He= > >> >measured the jitter in the picosecond range. >> > >> >The device he used was extremely cheap, and is not the same as the PIC= > >> >microcrollers, which could never give picosecond timimg. I believe it ha= >d >> >only 4 pins. >> > >> >I emailed him and asked for more information. >> > >> >I will post when he replies. >> Here is a Microchip PIC frequency counter: >> https://panteltje.nl/panteltje/pic/freq_pic/ >> coded by somebody else, just modified it for RS232 output as I had no suitable LCD, >> and put it in a RS232 connector housing. >> Modify it for any output? just use a preloaded downcounter? > >I believe I would add some input protection. Is that not a problem for you= >?
Well, 100 pF does not form a low impedance for slow things like mains. PIC datasheet specifies a clamp-current for the input pins; Clamp current, IK (VPIN < 0 or VPIN > VDD) &plusmn; 20 mA So now you can calculate how much and how fast an input voltage change you need with 100 pF for destruction. Ask Martin? Its still working AFAIK after so many years. But I do not work with pico seconds rise time kilovolts. Mostly use higher frequencies and spectrum analyzers based on RTL_SDR sticks, accuracy 1ppm and more info: http://panteltje.nl/pub/spectrum_analyzer_IX_IMG_0699.JPG http://panteltje.nl/pub/radar10_135000000_versus_1374576000_MHz.mpeg You can make it as complicated and precise as you want: https://panteltje.nl/pub/FPGA_board_with_25MHz_VCXO_locked_to_rubidium_10MHz_reference_IMG_3724.GIF https://panteltje.nl/pub/GPS_L1_locked_to_rubidium_reference_test_setup_IMG_3733.GIF was that not from my artificial GPS sattelite Mr Bond? Does this help?
On 27/06/2023 10:17, John Woodgate wrote:
> On Tuesday, June 27, 2023 at 8:15:58&#8239;AM UTC+1, Martin Brown wrote:
>> I'm curious - what is special about 1591.55 Hz ? >> >> To do that you actually want to divide 32768 by (almost) 20.6 which >> gets 1590.68 or easier 20.5 which gets 1598.44 >> >> 20 21 alternately and then combine with the original clock signal >> to get 20.5 20.5 equal mark space ratio at your chosen frequency. >> >> 20 21 20 21 20 would get your 20.6 but with terrible phase noise >> and harmonic content that might well be more problematic to >> eliminate.
>>> Is that the way it is set up? >> More likely how your news client is set up. Thunderbird has "Reply" >> (to author) as one of its buttons. >> >> Updates sometimes promote it to being the default action too! >> >> -- Martin Brown
> Thanks, Martin and all the others who have given helpful advice --- > too many to reply individually. The project is tutorial in nature, > so I don't want to use too many 'integrated' fixes, and SMD-only > devices are not an option. Regarding the frequency, it does need to > be near 10k/2pi, but other things can be adjusted to suit the exact > frequency, which needs to be stable within &plusmn;1% and not require a > counter to determine it.
OK. How about a Wein bridge sine wave oscillator instead then? eg. https://www.analog.com/en/technical-articles/analysis-of-a-digitally-controlled-wienbridge-oscillator.html You could even discipline it against a square wave reference frequency derived from the 32kHz xtal oscillator. -- Martin Brown
John Woodgate <jmw28563@gmail.com> wrote:
> On Tuesday, June 27, 2023 at 8:15:58&#8239;AM UTC+1, Martin Brown wrote: >> On 26/06/2023 23:54, John Woodgate wrote: >>> On Monday, June 26, 2023 at 11:39:14&#8239;PM UTC+1, Phil Hobbs wrote: >>>> Phil Hobbs <pcdhSpamM...@electrooptical.net> wrote: >>>>> John Woodgate <jmw2...@gmail.com> wrote: >>>>>> I want to divide a 32768 Hz crystal frequency by 20 to get a >>>>>> stable frequency for a component bridge. I could use a 4017 and >>>>>> half a a 4013 (sorry about these ancient devices, but they are >>>>>> still good for some things), but I would have to add something >>>>>> to make the crystal oscillate unless there is a way to use the >>>>>> other half of the 4013 to make the oscillator. >>>>>> >>>>>> I also looked at using just a 4096, which gives me the >>>>>> oscillator, but I can't see how to make it divide by 20. I know >>>>>> there is a technique that combines some of the output signals >>>>>> via an EXOR to achieve divisors that are not powers of 2, but I >>>>>> can't find information on which signals to combine. >>>>>> >>>>> >>>>> Hey, John, >>>>> >>>>> Nice to see you back on SED, man! An HC40103 will do it, if you >>>>> don&rsquo;t mind a 5% duty cycle. >>>>> >>>> Plus a 74HC1G04 or something for the oscillator. Cheers >>> >>> Thanks, Phil. I left SED when it turned into a political forum. I >>> will certainly look at 40103, but the duty cycle is a problem. I want >>> to filter the output to make a sine wave with not too much >>> distortion. I don't seem to be able to reply to this group by email. >> Depending on how much is not much then for a spot frequency integrating >> it once and diode shaping followed by a filter will get all the higher >> harmonics well down. HP patent on this trick is long out of date. >> >> I'm curious - what is special about 1591.55 Hz ? >> >> To do that you actually want to divide 32768 by (almost) >> 20.6 which gets 1590.68 or easier 20.5 which gets 1598.44 >> >> 20 21 alternately and then combine with the original clock signal to get >> 20.5 20.5 equal mark space ratio at your chosen frequency. >> >> 20 21 20 21 20 would get your 20.6 but with terrible phase noise and >> harmonic content that might well be more problematic to eliminate. >>> Is that the way it is set up? >> More likely how your news client is set up. >> Thunderbird has "Reply" (to author) as one of its buttons. >> >> Updates sometimes promote it to being the default action too! >> >> -- >> Martin Brown > Thanks, Martin and all the others who have given helpful advice --- too > many to reply individually. The project is tutorial in nature, so I > don't want to use too many 'integrated' fixes, and SMD-only devices are > not an option. Regarding the frequency, it does need to be near 10k/2pi, > but other things can be adjusted to suit the exact frequency, which needs > to be stable within &plusmn;1% and not require a counter to determine it. > > I will try 'Reply to list' instead of 'Reply' to see if that works. >
Some years ago, we had a George Herold thread on making sine waves. The eventual solution was a 4017 with resistors forming a weighted sum of the outputs. This cancels the second through ninth harmonics, making filtering much easier. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics
John Woodgate wrote:

-----------------------------------------
> > The project is tutorial in nature, so I don't want to use too many 'integrated' fixes, and SMD-only devices are not an option. > Regarding the frequency, it does need to be near 10k/2pi, but other things can be adjusted to suit the exact frequency, > which needs to be stable within &plusmn;1% and not require a counter to determine it. >
** OK - we finally have an actual " spec" for your 1591 Hz sine wave oscillator. This simple topology will do the job very easily: https://sound-au.com/project86.htm The DC supply can be to 9v as shown, or +/- 5V or up to +/- 15 v. Quad op-amps like the TL064 or TL074 are perfect - so are many other duals. THD is about 0.15% and frequency can be trimmed by adjusting one or both RT values as shown in fig 2. Amplitude stability depends only on the tempco of the 4 diodes. Essentially it is my design and many hundreds have been built. Way better than a Wein bridge topology since there's no need for ( now unobtainable) thermistors, tiny lamps or fussy FETs. .... Phil
On Tuesday, June 27, 2023 at 6:00:27&#8239;AM UTC-4, Jan Panteltje wrote:
> On a sunny day (Mon, 26 Jun 2023 23:20:14 -0700 (PDT)) it happened Ricky > <gnuarm.del...@gmail.com> wrote in > <c49794d7-262f-4006...@googlegroups.com>: > >On Tuesday, June 27, 2023 at 1:38:44&#8239;AM UTC-4, Jan Panteltje wrote: > >> On a sunny day (Tue, 27 Jun 2023 01:20:59 -0000 (UTC)) it happened Mike M= > >onett > >> VE3BTI <spa...@not.com> wrote in <XnsB02FD9304A...@135.181.20.170>: > >> >John Woodgate <jmw2...@gmail.com> wrote: > >> > > >> >> I want to divide a 32768 Hz crystal frequency by 20 to get a stable > >> >> frequency for a component bridge. I could use a 4017 and half a a 4013= > > > >> >> (sorry about these ancient devices, but they are still good for some= > > > >> >> things), but I would have to add something to make the crystal oscilla= > >te > >> >> unless there is a way to use the other half of the 4013 to make the > >> >> oscillator. > >> >> > >> >> I also looked at using just a 4096, which gives me the oscillator, but= > > I > >> >> can't see how to make it divide by 20. I know there is a technique tha= > >t > >> >> combines some of the output signals via an EXOR to achieve divisors th= > >at > >> >> are not powers of 2, but I can't find information on which signals to= > > > >> >> combine. > >> > > >> >Tom Van Baak, moderator of the Time-Nuts group, posted an article years = > >sgo > >> >on using a PIC to count down from 2 to 255. It had very low jitter. He= > > > >> >measured the jitter in the picosecond range. > >> > > >> >The device he used was extremely cheap, and is not the same as the PIC= > > > >> >microcrollers, which could never give picosecond timimg. I believe it ha= > >d > >> >only 4 pins. > >> > > >> >I emailed him and asked for more information. > >> > > >> >I will post when he replies. > >> Here is a Microchip PIC frequency counter: > >> https://panteltje.nl/panteltje/pic/freq_pic/ > >> coded by somebody else, just modified it for RS232 output as I had no suitable LCD, > >> and put it in a RS232 connector housing. > >> Modify it for any output? just use a preloaded downcounter? > > > >I believe I would add some input protection. Is that not a problem for you= > >? > > Well, 100 pF does not form a low impedance for slow things like mains. > PIC datasheet specifies a clamp-current for the input pins; > Clamp current, IK (VPIN < 0 or VPIN > VDD) &plusmn; 20 mA > So now you can calculate how much and how fast an input voltage change you need with 100 pF for destruction. > Ask Martin? > Its still working AFAIK after so many years. > But I do not work with pico seconds rise time kilovolts. > Mostly use higher frequencies and spectrum analyzers based on RTL_SDR sticks, accuracy 1ppm and more info: > http://panteltje.nl/pub/spectrum_analyzer_IX_IMG_0699.JPG > http://panteltje.nl/pub/radar10_135000000_versus_1374576000_MHz.mpeg > > You can make it as complicated and precise as you want: > https://panteltje.nl/pub/FPGA_board_with_25MHz_VCXO_locked_to_rubidium_10MHz_reference_IMG_3724.GIF > https://panteltje.nl/pub/GPS_L1_locked_to_rubidium_reference_test_setup_IMG_3733.GIF > was that not from my artificial GPS sattelite Mr Bond? > > Does this help?
What's the rise time of touching some voltage rail? I don't see even a resistor, to allow the capacitor to form an RC circuit, so I suppose this is depending on the parasitic diodes to prevent damage. That's my point. There's nothing to limit the current through the diodes, including your nonsense about kilovolt, ps rise time signals. -- Rick C. -+ Get 1,000 miles of free Supercharging -+ Tesla referral code - https://ts.la/richard11209
On Tuesday, June 27, 2023 at 5:17:21&#8239;AM UTC-4, John Woodgate wrote:
> On Tuesday, June 27, 2023 at 8:15:58&#8239;AM UTC+1, Martin Brown wrote: > > On 26/06/2023 23:54, John Woodgate wrote: > > > On Monday, June 26, 2023 at 11:39:14&#8239;PM UTC+1, Phil Hobbs wrote: > > >> Phil Hobbs <pcdhSpamM...@electrooptical.net> wrote: > > >>> John Woodgate <jmw2...@gmail.com> wrote: > > >>>> I want to divide a 32768 Hz crystal frequency by 20 to get a > > >>>> stable frequency for a component bridge. I could use a 4017 and > > >>>> half a a 4013 (sorry about these ancient devices, but they are > > >>>> still good for some things), but I would have to add something > > >>>> to make the crystal oscillate unless there is a way to use the > > >>>> other half of the 4013 to make the oscillator. > > >>>> > > >>>> I also looked at using just a 4096, which gives me the > > >>>> oscillator, but I can't see how to make it divide by 20. I know > > >>>> there is a technique that combines some of the output signals > > >>>> via an EXOR to achieve divisors that are not powers of 2, but I > > >>>> can't find information on which signals to combine. > > >>>> > > >>> > > >>> Hey, John, > > >>> > > >>> Nice to see you back on SED, man! An HC40103 will do it, if you > > >>> don&rsquo;t mind a 5% duty cycle. > > >>> > > >> Plus a 74HC1G04 or something for the oscillator. Cheers > > > > > > Thanks, Phil. I left SED when it turned into a political forum. I > > > will certainly look at 40103, but the duty cycle is a problem. I want > > > to filter the output to make a sine wave with not too much > > > distortion. I don't seem to be able to reply to this group by email. > > Depending on how much is not much then for a spot frequency integrating > > it once and diode shaping followed by a filter will get all the higher > > harmonics well down. HP patent on this trick is long out of date. > > > > I'm curious - what is special about 1591.55 Hz ? > > > > To do that you actually want to divide 32768 by (almost) > > 20.6 which gets 1590.68 or easier 20.5 which gets 1598.44 > > > > 20 21 alternately and then combine with the original clock signal to get > > 20.5 20.5 equal mark space ratio at your chosen frequency. > > > > 20 21 20 21 20 would get your 20.6 but with terrible phase noise and > > harmonic content that might well be more problematic to eliminate. > > > Is that the way it is set up? > > More likely how your news client is set up. > > Thunderbird has "Reply" (to author) as one of its buttons. > > > > Updates sometimes promote it to being the default action too! > > > > -- > > Martin Brown > Thanks, Martin and all the others who have given helpful advice --- too many to reply individually. The project is tutorial in nature, so I don't want to use too many 'integrated' fixes, and SMD-only devices are not an option. Regarding the frequency, it does need to be near 10k/2pi, but other things can be adjusted to suit the exact frequency, which needs to be stable within &plusmn;1% and not require a counter to determine it. > > I will try 'Reply to list' instead of 'Reply' to see if that works.
Why the requirement to not use a counter??? I don't know what that means in this context, since you are proposing on using a counter. Can you explain? -- Rick C. +- Get 1,000 miles of free Supercharging +- Tesla referral code - https://ts.la/richard11209