From: ClueLess on
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
From: John Fields on
On Wed, 16 Dec 2009 19:51:26 +0530, ClueLess
<clueless(a)wilderness.org.invalid> wrote:

>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?

---
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
From: whit3rd on
On Dec 16, 6:21 am, ClueLess <cluel...(a)wilderness.org.invalid> wrote:

> 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.

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.
From: Phil Allison on

"John Fields"

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


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


.... Phil


From: Phil Allison on

"ClueLess
>
> 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?


** 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