6
\$\begingroup\$

I'm using a PIC18F47J53 in a project. Because I need to use Full-Speed USB 2.0, I can't use the internal 8MHz oscillator because it's not stable enough (*). Although Microchip has a lot of interesting application notes on Oscillator design (FACT001, AN849, AN949), I found a good Application report from Texas Instruments (SLLA122 - December 2002) which helps choosing the right components, including the XTAL.

Selection and Specification of Crystals for Texas Instruments USB 2.0 Devices

To summarize the crystal specifications:

  • Mode of operation: fundamental
  • Crystal circuit type: parallel resonant
  • Frequency Tolerance: ±50 ppm (maximum: ±100 ppm)
  • Frequency Stability: ±50 ppm (maximum: ±100 ppm)
  • Aging (Long Term Stability): ±5 ppm per year
  • Maximum Equivalent Series Resistance: 50 Ω (100 Ω, if CL1 and CL2 <10 pF)

With this information, I could easily find the XTAL to use in my project.

But I have 1 question:

Is there a difference when I use a 8MHz or 16MHz XTAL? If you look at the PIC18F47J53 FAMILY CLOCK DIAGRAM, you can use both to drive the PLL Prescaler which at the end generates a 48MHz signal, that is then used for the Full-Speed USB Module and can also directly be used as CPU primary clock source.

Is there any reason why I should prefer 8MHz or 16MHz? As both can create the same result. I could easily find a XTAL of both frequencies that comply with the specifications above. Or is the price difference of 0.08 EUR (0.27 EUR for 8MHz, 0.35 EUR for 16MHz) the only reason to choose one or the other?


(*) Remark: I used the PIC18F45K50 before, which does support Full-Speed USB while using the internal oscillator. This is possible because 1) it has a 16MHz internal oscillator, and 2) because it has an Active Clock Tuning (ACT) Module, which can use the Full-Speed USB signal as reference. Unfortunately, due to the worldwide chip shortage, the PIC18F45K50 is not available until somewhere in 2023. That's why I searched for an alternative that is immediately available with some suppliers, which is the PIC18f47J53.

\$\endgroup\$
3
  • \$\begingroup\$ I don't know of a good reason to choose one over the other. I seem to recall that the thickness shear mode is used for anything above about 1 MHz. And both of those are above that line. There are some tempco-related reasons for slight variations in the AT cut itself. But those considerations would apply to both, I think. Perhaps someone else knows something, though. \$\endgroup\$
    – jonk
    Commented Jun 20, 2022 at 18:46
  • \$\begingroup\$ If timing is critical, e.g., for MIDI, there might be some slight advantage in accuracy to the 16 MHz... or not. Price and availability, as you state, are the reason to choose one or the other. BTW, ceramic resonators are far less stable and accurate than quartz. \$\endgroup\$ Commented Jun 20, 2022 at 18:48
  • \$\begingroup\$ @DrMoishePippik The crystal is anyway used to run the MCU via a PLL at 48 MHz so they would be just as accurate. Even if it wasn't, what advantage would a 16 MHz MCU frequency give for MIDI instead of 8 MHz? \$\endgroup\$
    – Justme
    Commented Jun 20, 2022 at 19:55

3 Answers 3

8
\$\begingroup\$

I don't think there is a lot of difference, all other things being equal. Both are more-or-less in the optimal range for inexpensive and widely available crystals.

Case size is probably a bigger variable than this particular 2:1 variation in resonant frequency.

I would use one that is already on another product's BOM if possible. Or if not, pick the one that is slightly cheaper.

\$\endgroup\$
3
\$\begingroup\$

It depends on what limitations you have.

For example higher freqency crystals can come in smaller packages than lower frequency crystals.

And while it may not apply to the PIC MCUs specifically, but given any oscillator, you generally require tighter specs for higher freqency crystals, such as lower load capacitance and ESR ratings, to make them start up and oscillate reliably with enough margin in all situations.

Therefore wider selection of suitable 8 MHz crystals are available compared to 16 MHz crystals.

The PIC seems to work with any multiple of 4 MHz as even the 8 MHz is prescaled down to 4 MHz for the PLL. So you could use 12 MHz crystal too.

\$\endgroup\$
2
\$\begingroup\$

2 main differences, from the data sheet:

8 MHz clock will run at a slightly lower operating voltage than 16 MHz.

enter image description here

16MHz will run higher current. You have to extrapolate here, but more than double the supply current, important for battery operation:

enter image description here

\$\endgroup\$
3
  • 6
    \$\begingroup\$ This is not really true. The PLL has to run at 96MHz for the HS USB to work and the notes you have above indicate that the core voltage must be the same as if the clock was operating at 48MHz. Also note that with either crystal you can select a CPU clock of 8, 16, 24 or 48MHz with HS USB enabled via CPDIV. This is not your grandpa's 8-bit MCU where crystal frequency = CPU clock (or CPU clock *4 in the case of early PICs). \$\endgroup\$ Commented Jun 20, 2022 at 19:03
  • 4
    \$\begingroup\$ Thanks for your feedback John. But these graphs and table don't say anything about the XTAL used. They show the Frequency at which the processor runs. But as @SpehroPefhany also says, you can reach that frequency with a huge range of XTALS. I run my processor at maximum speed (48MHz) whether I use a 8 MHz or 16 MHz XTAL. I just need to use a different divider in the Prescaler. So if we take the VDDcore graph above, I will need 2.35V, independent on the fact whether I use a 8 MHz or 16 MHz crystal. \$\endgroup\$ Commented Jun 21, 2022 at 5:20
  • \$\begingroup\$ Gotcha. I am in a power sensitive world and try to run slowly, and I missed that you were running 48MHz. If you're running with a PLL, I would go with the higher frequency. \$\endgroup\$ Commented Jun 21, 2022 at 19:58

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.