Can't get T1 to run on external clock source

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Watch crystals are made to run at very low power. You may be damaging your crystals. You _must_ have a high value resistor between the output of the oscillator and the crystal/cap. This resistor is typically 300k to 1meg ohm.

The old RCA data book I have attached shows has how to calculate the correct value. See page 57 in the data book for crystal oscillators.

Microchip does not mention it.

http://ww1.microchip.com/downloads/en/AppNotes/01288A.pdf
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Set up an LED to flash, say once per second, based on T1, then count flashes against a clock seconds readout.

Yeah I know that. See above. That is far from an accurate method to measure the speed of the timer's clock. A better method (as I mentioned above) would be to change the value of a pin at a higher rate then measure with a scope but that has code overhead that would need to be considered in reading the output.
 

AlbertHall

Joined Jun 4, 2014
12,345
It can be as accurate as you want make it. With one flash per second, each flash should coincide with the movement of the second hand or the changing of the seconds digit (as appropriate) on the clock. If the crystal and the clock are exactly synchronous then the timing of the two events will gradually drift with respect to each other. Note how long it takes to drift from synchronous to the next time they are synchronous then you have a pretty accurate estimate of the crystal frequency.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
It can be as accurate as you want make it. With one flash per second, each flash should coincide with the movement of the second hand or the changing of the seconds digit (as appropriate) on the clock. If the crystal and the clock are exactly synchronous then the timing of the two events will gradually drift with respect to each other. Note how long it takes to drift from synchronous to the next time they are synchronous then you have a pretty accurate estimate of the crystal frequency.

No it can't. It relies on my eye and how I can compare to a clock. a horrible method for testing accuracy.

What I have done in the past is to run the code for a long period of time, updating a counter. After an extended period I check the counter. But I am not satisfied with that method either.

I am looking for a way to output the clock directly but I am not seeing it in the datasheet. I can seem to be able to output the system clock so perhaps I can use the crystal as a system clock for a test.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
This explains why I am not able to measure the clock with a scope.

A regular oscilloscope probe has
10-12 pF of capacitance, which can be sufficient to stop
oscillations. It is recommend that low-capacitance
probes be used, preferably with a JFET input, and that
the OSC2 pin be probed instead of OSC1.
 

RichardO

Joined May 4, 2013
2,270
This explains why I am not able to measure the clock with a scope.

A regular oscilloscope probe has
10-12 pF of capacitance, which can be sufficient to stop
oscillations. It is recommend that low-capacitance
probes be used, preferably with a JFET input, and that
the OSC2 pin be probed instead of OSC1.
And even if the scope probe doesn't stop the oscillation it will significantly effect the oscillation frequency (in clock accuracy terms).

If you don't have a FET probe then just use a high value resistor held in the probe tip. Since the signal is only 32KHz the resistor can be a high value without causing a huge high frequency rolloff. I would try a 1 megohm resistor with very short leads. This will let you see if the oscillator is running but it will still effect the frequency some.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
And even if the scope probe doesn't stop the oscillation it will significantly effect the oscillation frequency (in clock accuracy terms).

If you don't have a FET probe then just use a high value resistor held in the probe tip. Since the signal is only 32KHz the resistor can be a high value without causing a huge high frequency rolloff. I would try a 1 megohm resistor with very short leads. This will let you see if the Cis running but it will still effect the frequency some.

I will give that a try. Thanks.

Oscillator is running now. What I really want to do is measure it. But sounds like I will need a jfet probe which does not seem to be very affordable.
 

RichardO

Joined May 4, 2013
2,270
Oscillator is running now. What I really want to do is measure it. But sounds like I will need a jfet probe which does not seem to be very affordable.
I would not waste my money on a FET probe that will only be used rarely. Instead, I would monitor the output of an internal (T1?) counter clocked by the oscillator and mirror the state to another output pin. Use the output pin for your frequency measurement. Make very sure that there are no ground loops when you do this measurement. Any interaction between the currents in the ground of the oscillator circuit and the measurement ground will effect the oscillator frequency.
 
Top