Measuring crystal frequency - HELP!

Not on an arduino project, but I would like some help.

I have a project with a 12Mhz crystal.

It is connected to two pins of the PIC and two capacitors going to +5v.

I have a handhelp scope (Jaycar) but am not sure how to get an output of the frequency.

I believe it is the input to the crystal and the common to Ground.

Correct?

Oh, and if someone could comment on what is going on, I'd like a bit of help.

When I plug it in to the USB port, NOTHING happens. There are two LED's and they are off.
They should be on, but aren't. Poking around with my DMM, I put the leads across the crystal.

Suddenly it came to life - the LED's came on.

I didn't have it plugged into the computer. I had it plugged into a USB phone charger.

I am still to plug it into a computer and try again, but in the mean time I thought I could ask and maybe learn what is going on.

Thanks in advance.

Sounds like you have to play around with the crystal capacitors.
Usually you cannot measure the output of the oscillator as the probe loads it down.
Consider taking the output to a CMOS inverter then monitor it's output instead.

It is connected to two pins of the PIC and two capacitors going to +5v.

A good practice is to have capacitors going to Gnd, even it does not matter with good decoupling (good decoupling??).

I believe it is the input to the crystal and the common to Ground.

A good practice is to connect the o’scope to output of the crystal oscillator - see the datasheet which oscillator’s pin is the input and which is the output. Try to use a small capacitor (ie 4.7pF) in series with your probe’s tip.
The best way to measure the oscillator’s frequency (pic or avr or other) is to feed the clock (or its fraction) to an output pin and to measure there…

OK, maybe it is the caps go to GND.

The project is from a mag 2 years ago and it has been "Stalled" for a long time.

I measure 2.4 volts (DC) on each side to ground.

The crystal is pretty much:
cap to GND and input of the PIC.
That is both pins.
Just walked over and looked at the PCB.

There aren't any more things connected to the crystal.

So it is funny that if I put the DMM across the crystal, suddenly it (the whole thing) seems to come to life.

Crystal oscillators in PICs and AVRs are supply voltage dependant for a given crystal frequency , and also very dependant of the value of the capacitors from either side of the crystal to ground.
The crystal itself is also important, as it needs to be a parallel mode crystal.
Usually, the datasheet for the Pic or AVr will tell you what the optimum capacitor values should be .
You can measure the frequency with a X10 Cro probe connected to the output pin of the oscillator, but the best most reliable way
is to use the CLKOUT option which most PICs and AVRs have and simply measure the freqency on the CLKOUT pin.

is to use the CLKOUT option which most PICs and AVRs have and simply measure the freqency on the CLKOUT pin.

I can't over state enough that this is the best way to measure the actual AVR clock speed as any direct connections with all but the best quality (and expensive) test equipment to the crystal pins is sure to effect (change by some amount) the frequency. As my signature says "measurement changes behavior'.

Hi, you may need to change the two caps on the crystal to get it to kick start, what value are they at the moment, and are they ceramic type.
A picture would help.

Tom.... :slight_smile:

lost_and_confused:
OK, maybe it is the caps go to GND.

The project is from a mag 2 years ago and it has been "Stalled" for a long time.

I measure 2.4 volts (DC) on each side to ground.

The crystal is pretty much:
cap to GND and input of the PIC.
That is both pins.
Just walked over and looked at the PCB.

There aren't any more things connected to the crystal.

So it is funny that if I put the DMM across the crystal, suddenly it (the whole thing) seems to come to life.

Do you have a bias resistor across the crystal? There should be about a 1 meg ohm (brown, black, green) resistor across the crystal.

The parallel resistor is normally in the PIC or AVR.
Without it , the oscillator wont run at all.

mauried:
The parallel resistor is normally in the PIC or AVR.
Without it , the oscillator wont run at all.

Really? I build boards all the time with ATMega328P-PU chips and use a 16 or 20Mhz crystal along with two 22pf caps and it runs fine without any parallel resistor there once I switch the chip's fuses over to external oscillator.

This has been discussed here: 1M resistor across crystal ? - General Electronics - Arduino Forum

Parallel resistor looks to be optional except for some unusual crystals, none of which I have ever run across.

The parallel resistor is in the AVR, you cant switch it out.
You dont need an external parallel resistor.

mauried:
The parallel resistor is in the AVR, you cant switch it out.
You dont need an external parallel resistor.

Ah, you said "AVR" and I read "Arduino". My fault. The Arduino UNO R3 has an additional external parallel 1M resistor, that is the one I was talking about. It appears to be unnecessary in most circumstances, but doesn't cause any side-effects so appears to be a good design choice.

ExternalResistor.png

lost_and_confused:
OK, maybe it is the caps go to GND.

If there noise on Vcc then its not going to be great to put the crystal load caps to Vcc,
especially if a low-power xtal oscillator circuit is used which is more sensitive to noise.
You could try adding strong decoupling (1uF ceramic) from Vcc to GND right on those
load caps I suppose.

JoeN:

mauried:
The parallel resistor is in the AVR, you cant switch it out.
You dont need an external parallel resistor.

Ah, you said "AVR" and I read "Arduino". My fault. The Arduino UNO R3 has an additional external parallel 1M resistor, that is the one I was talking about. It appears to be unnecessary in most circumstances, but doesn't cause any side-effects so appears to be a good design choice.

I question the accuracy of that schematic as the current arduino R3s seem to ship with a 16 MHz crystal for the 16u serial converter chip but utilize a 16 MHz ceramic resonator (with internal caps) for the 328p chip. I don't own a R3 but that's what has been reported by many.

retrolefty:

JoeN:

mauried:
The parallel resistor is in the AVR, you cant switch it out.
You dont need an external parallel resistor.

Ah, you said "AVR" and I read "Arduino". My fault. The Arduino UNO R3 has an additional external parallel 1M resistor, that is the one I was talking about. It appears to be unnecessary in most circumstances, but doesn't cause any side-effects so appears to be a good design choice.

I question the accuracy of that schematic as the current arduino R3s seem to ship with a 16 MHz crystal for the 16u serial converter chip but utilize a 16 MHz ceramic resonator (with internal caps) for the 328p chip. I don't own a R3 but that's what has been reported by many.

Maybe it needs to be updated, but I got it from the most authoritative source I could find:

I have an R3 clone and it sure looks like a resonator to me. It has 3 leads. So does my R2.

pegwatcher:
I have an R3 clone and it sure looks like a resonator to me. It has 3 leads. So does my R2.

What kind of resonator? There are crystal resonators and ceramic resonators.