Check frequency

Hi all

I have a requirement to exactly adjust the frequency of a microcontroller system (8051) that works with the 32768 Hz watch crystal.

I am not an electronics engineer but a hobby type. I will thank you to please let me know how the system can made to work exactly at the above frequency. Trimmers are provided. my understanding is that you need an oscilloscope to do this. In that case what kind should I go for? Os is there a simpler methods?

--
Thank you very much for your time

ClueLess
Reply to
ClueLess
Loading thread data ...

--- For this application an oscilloscope will be useless and you should use a frequency counter.

In order to keep from loading the crystal, what I'd do would be to wind an air-cored coil, about an inch in diameter and 10 - 20 turns wide with its ends soldered to a BNC female connector. Then connect it to one end of a piece of coaxial cable terminated in BNC males and connect the other end of the cable to the counter's frequency input.

Set the counter's trigger level control close to zero and place the coil in the vicinity of the crystal. You'll probably have to fiddle with the coil placement and the trigger level control to get a reading, but when you do then you'll be able to trim the crystal to 32768.XXXXXXX Hz depending on the accuracy of the counter. Once you get it set, move the coil around to make sure that it's not interacting with the crystal by observing that the reading doesn't change, and you'll be set.

Another way would be to write a little routine which would force an IO high for a known period of time with a clock frequency of 32768 Hz and then to measure the period of the pulse with a counter and trim the oscillator until the period was precisely what it should be.

For example, if the period of the pulse was supposed to be 100 clock cycles long, including all of the instruction execution times, then the width of the output pulse would be:

1 T = --------- * 100 = 3.051757E-3 seconds 32768Hz

The advantage of this method would be not having to screw around with hardware, while the disadvantage, of course, would be keeping track of all those instruction cycles (only once, though...).

JF

Reply to
John Fields

Define 'exactly'. You will need a very accurate standard to compare your oscillator with, and the crystal won't allow much alteration of frequency, regardless of 'trimmers'.

An oscilloscope and Lissajous techniques can do part of the job, but frequency accuracy can be a challenging task; some clocks reach ten significant figures, it matters a LOT what your accuracy requirement is.

Reply to
whit3rd

"John Fields"

** Shame how even the cheapest DSOs have built in frequency measurement to 5 decimal places.

... Phil

Reply to
Phil Allison

"ClueLess

** To get the frequency exact, you need resolution better than 1 Hz - one way is to use a frequency counter that can be set to count for 10 seconds - giving you 327 thousand odd counts on the display.

Picking up a signal voltage from the crystal without disturbing it is a problem too - most counters would stop the oscillations if directly connected.

Time for a Reality check:

Just how " exact " do you really need it ??

A watch crystal will be within about 30ppm (or 1 Hz ) with no adjustment.

To get better accuracy, you will need at a dual trace scope and a quartz clock that keeps good time.

Dunno why you are playing with uPs when you have no scope.

.... Phil

Reply to
Phil Allison

Set the device up to count cycles between input pulses and feed it the

1 Hz pulse train from a GPS, trim until you get close enough to 32768
Reply to
Jasen Betts

"Jasen Betts"

** Sheep shagger extraordinaire.

** The crystal will be 32.768 kHz out of the box.

Idiot.

.... Phil

Reply to
Phil Allison

--
Shame how analog scopes, which is (since he didn't say "DSO") what he
was talking about, don't.

JF
Reply to
John Fields

--
Actually, out of the box it'll be a little high.
Reply to
John Fields

--
I don't think so.

If you've got a 32768 Hz crystal in an oscillator and you want to
measure the output frequency to an accuracy of, say, +/- one part in
32768, then if you use a 1 second timebase to accumulate cycles it has
to have a resolution of +/- 30.51757... µs
Reply to
John Fields

Then they run in circles chasing it. :)

--
Offworld checks no longer accepted!
Reply to
Michael A. Terrell

"John Fields" "Phil Allison"

** Pedantic bollocks.

The OP is a novice and has no scope at present.

A low price ( ie $300) DSO is just what he should get.

.... Phil

Reply to
Phil Allison

"John Fields" "Phil Allison"

** You don't think straight at all.

Never have.

** Meaningless drivel.

..... Phil

Reply to
Phil Allison

--
Got any suggestions as to which one?

JF
Reply to
John Fields

--- Just because you don't recognize it as straight thinking doesn't mean it isn't.

For example, if you think that the '8' in 32768 Hz represents 1 Hz, as you seem to indicate, I suggest you consider that it represents 1 part in 32768 Hz, which is ~ 30.5µs, not 1s/1Hz.

---

--- How would you state it then?

JF

Reply to
John Fields

Thank you very much got your very detailed suggestions, I will look for a frequency counter and try as you said.

--
Thanks again
ClueLess
Reply to
ClueLess

"ClueLess" John Fields

** Don't do that.

That advice is crap and will not work.

Get a scope with two traces.

But first tell US what sort of accuracy you NEED and why !!

..... Phil

Reply to
Phil Allison

"John Fields" "Phil Allison"

** Fraid it is just more of your crazed, autistic crapology.

** Fraid it is just more of your crazed, autistic crapology.

...... Phil

Reply to
Phil Allison

Er... no, that's not right. If you have a suitable reference frequency source, you can watch the pretty Lissajous figure on an X/Y oscilloscope (no dual channel, no counter) and if it goes through a cycle in 100 seconds, with 0.1 second stopwatch accuracy, you've just made a frequency measurement with .001 Hz accuracy. For your

32 kHz crystal, that's a second per year kind of accuracy.

A frequency counter is a convenient and quick solution, but it is NOT required nor is it superior in accuracy.

Reply to
whit3rd

"whit3rd" ClueLess John Fields

Er... no, that's not right. If you have a suitable reference frequency source, you can watch the pretty Lissajous figure on an X/Y oscilloscope (no dual channel, no counter) and if it goes through a cycle in 100 seconds, with 0.1 second stopwatch accuracy, you've just made a frequency measurement with .001 Hz accuracy. For your

32 kHz crystal, that's a second per year kind of accuracy.

A frequency counter is a convenient and quick solution, but it is NOT required nor is it superior in accuracy.

** Ask JF where the OP can get an affordable counter that reads a frequency in Hz to seven decimal places - as in his " 32768.XXXXXXX Hz ".

His magic 10 turn crystal PU loop need to be patented too.

...... Phil

Reply to
Phil Allison

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.