2
\$\begingroup\$

I'm using a 7.3728 MHz HC-49 crystal with 22pF disc ceramic load capacitors. I'm doing this on a breadboard, but I've had prior experience with using a breadboard for this and it has worked well, so I'm hoping this is not the problem. On the crystal, the following is written: "ACT Fo 7.3728SCA" and I've tracked the datasheet down to this one. The load capacitance is correct it seems - well within the specified 12pF to 32pF. I'm using with a PIC24FJ64GA002 microcontroller and the microcontroller is set to HSPLL mode, to generate a 29.4912MHz clock. The clock is a baud multiple, and it's very important it's stable. The expected clock is 7.3728 MHz within 50ppm, but the achieved clock is unstable and I can just about measure 20 MHz using my scope, but even that's tricky because it won't trigger well on such an unstable waveform.

Here's the waveform I'm talking about. Notice how unstable it is. Since I tried last night, it changed frequency from 20 MHz down to 10 MHz. What is going on??

enter image description here

My scope only has a limited sample memory of 1K and doesn't sample nearly as fast as a modern one (it does 10 MS/a real time, 10 GS/a equivalent time), but even so I should still be able see a clock frequency.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ "The load capacitance is correct it seems - well within the specified 12pF to 32pF." - How do you know this? The inductance of the breadboard, even the leads of the crystal, pic, and caps can cancel out a lot of your capacitance. \$\endgroup\$
    – Kellenjb
    Commented Feb 25, 2011 at 14:29
  • \$\begingroup\$ @Kellenjb - you could be correct, but I have no means to measure this. I've done this before on a breadboard which is why I'm suspicious that it is the breadboard. I'm tempted to try another crystal - will report back. \$\endgroup\$
    – Thomas O
    Commented Feb 25, 2011 at 15:18
  • \$\begingroup\$ MS/a = megasamples per annum (year)? \$\endgroup\$
    – Nick T
    Commented Feb 25, 2011 at 17:01
  • \$\begingroup\$ @Nick T, megasamples per second. It's written on the case and in the manual. MS/a. I think it differentiates from the real time sample rate of 10 G/S. \$\endgroup\$
    – Thomas O
    Commented Feb 25, 2011 at 17:53

4 Answers 4

3
\$\begingroup\$
  • Is there a short, solid connection between the load capacitors and a GND pin of your MCU?
  • Have you read the errata for your chip?
  • Solderless breadboards are notorious for unwanted parasitic capacitance and inductance.

You may be overdriving your crystal. Have you read "Microchip AN943: Practical PICmicro® Oscillator Analysis and Design"? In particular, check out Figure 13 and the surrounding text -- it sounds like you need to increase the value of your "Rs" resistor.

\$\endgroup\$
4
\$\begingroup\$

It might be oscillating on the third harmonic because of the poor layout. I'd avoid those solderless breadboards, especially with those 16-bit PICs.

\$\endgroup\$
3
  • \$\begingroup\$ Would this also cause it to be really unstable? \$\endgroup\$
    – Thomas O
    Commented Feb 24, 2011 at 22:13
  • 1
    \$\begingroup\$ @Thomas - Yes. You might get better luck if you bend the OSC pins of the micro up and out of the breadboard, and solder your crystal and caps directly to those pins and the neighboring ground pin. \$\endgroup\$ Commented Feb 24, 2011 at 22:34
  • \$\begingroup\$ @reemrevnivek, That's unfortunately not an option given that this is one of few chips I have and I can't ruin it. I've run an 8 MHz oscillator on a breadboard before - heck, I've run a 20 MHz one too - so I'm thinking it's more likely my construction than the breadboard. \$\endgroup\$
    – Thomas O
    Commented Feb 25, 2011 at 1:53
3
\$\begingroup\$

I'm guessing the 'scope input capacitance, in addition to the breadboard capacitance, is changing the load capacitance by quite a bit, bumping the generated frequency to a higher harmonic (3rd). If I remember correctly, you have an older analog.

\$\endgroup\$
2
  • \$\begingroup\$ Nope, I have a digital scope - always had it, although it is nearly 19 years old. I don't think this is causing the problem since the oscillator is erratic anyway, I can see this from a UART output. \$\endgroup\$
    – Thomas O
    Commented Feb 25, 2011 at 0:49
  • \$\begingroup\$ Can you have a look at the trace and tell me if it is this problem or something else. \$\endgroup\$
    – Thomas O
    Commented Feb 25, 2011 at 13:01
1
\$\begingroup\$

I would suspect crack on a crystal. Especially if you get normal freq on different xtal.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ I changed the crystal, this is two crystals showing the same behaviour. \$\endgroup\$
    – Thomas O
    Commented Feb 24, 2011 at 21:33
  • \$\begingroup\$ Are there decoupling ceramic cap right on pins of your uC? \$\endgroup\$ Commented Feb 25, 2011 at 8:51
  • \$\begingroup\$ Yes. \$\endgroup\$
    – Thomas O
    Commented Feb 25, 2011 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.