2

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.

Thomas O
  • 31,786
  • 58
  • 184
  • 322
  • 1
    "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. – Kellenjb Feb 25 '11 at 14:29
  • @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. – Thomas O Feb 25 '11 at 15:18
  • MS/a = megasamples per annum (year)? – Nick T Feb 25 '11 at 17:01
  • @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. – Thomas O Feb 25 '11 at 17:53

4 Answers4

4

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.

Leon Heller
  • 38,983
  • 2
  • 62
  • 96
  • Would this also cause it to be really unstable? – Thomas O Feb 24 '11 at 22:13
  • 1
    @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. – Kevin Vermeer Feb 24 '11 at 22:34
  • @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. – Thomas O Feb 25 '11 at 01:53
3

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.

tyblu
  • 8,207
  • 6
  • 41
  • 70
  • 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. – Thomas O Feb 25 '11 at 00:49
  • Can you have a look at the trace and tell me if it is this problem or something else. – Thomas O Feb 25 '11 at 13:01
3
  • 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.

davidcary
  • 17,606
  • 11
  • 67
  • 117
1

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

BarsMonster
  • 3,327
  • 5
  • 46
  • 80