Crystal selection for PIC24F series - Page 1
Forum section: electronics / projects

author: osmosis321
author_rank: Regular Contributor
timestamp: February 08, 2011, 05:54:09 pm
content: Wow, the 24F series can run at up to 32MHz, all I need to do is get a crystal that runs at that frequency and Bob will be my uncle. Or so I thought.When I scoped it, the signal was only 10.6667MHz, and when I read the fine print on the crystal datasheet, wouldn't you know it, 32MHz is the third harmonic.I know what that means but I don't know what I need to do to get it to operate at full frequency. The easiest thing to do would be to get a different crystal, but will it really be that simple..?

author: Zero999
author_rank: Super Contributor
timestamp: February 08, 2011, 08:15:58 pm
content: Assuming you're using a 32MHz crystal this is pretty common. Adjusting the loading capacitance or being more careful with the layout might help.

author: tecman
author_rank: Frequent Contributor
timestamp: February 09, 2011, 05:16:37 am
content: Use an 8 Mhz xtal and the internal PLL to get 32 Mhz.paul

author: osmosis321
author_rank: Regular Contributor
timestamp: February 09, 2011, 07:19:40 am
content: Quote from: tecman on February 09, 2011, 05:16:37 amIt can't be that easy.. but I'll try it anyway.

author: alexh
author_rank: Contributor
timestamp: February 09, 2011, 08:19:31 am
content: As tecman said you can perfectly use for example an 8 MHz crystal (or for that matter a 4, 12, 20MHz, ...). You just need to adjust the PLLDIV. You could even use the 8MHz internal oscillator block; thanks to the PLL you can generate all the required frequencies from that.Regards,Alex

author: cyberfish
author_rank: Regular Contributor
timestamp: February 11, 2011, 11:48:54 pm
content: I usually use 4MHz crystal for any frequency.If you want to do UART, or other things that require accurate timing, you'll need an external crystal. Otherwise internal one may work.

author: red_mamba
author_rank: Contributor
timestamp: February 22, 2011, 01:21:04 pm
content: You can use internal oscillator for UART to, you just have to tune it to the right frequencyYou could even do an auto tune on start up

author: metalphreak
author_rank: Frequent Contributor
timestamp: February 23, 2011, 01:27:10 am
content: Yeah there's no need to buy a higher frequency crystal for faster operation. For example, the PIC 18F2550 USB chips I've been using lately can be used with 4/8/12/16/20Mhz crystals. All it does internally is divide the clock signal to get a 4mhz input. A 4Mhz crystal would have NODIV, while 8mhz would have DIV2 and so on. The 4Mhz signal is then used by the PLL to generate the other required frequencies (48Mhz for USB and so on).If you have a look at the block diagram in the datasheet for the microchip you are using, you can see how it all works

author: ElektroQuark
author_rank: Unknown
timestamp: February 23, 2011, 08:46:57 am
content: But from the 4 to 20MHz range, is any xtal recommended? If so, why?

author: tecman
author_rank: Frequent Contributor
timestamp: February 23, 2011, 03:21:34 pm
content: Quote from: EdoNork on February 23, 2011, 08:46:57 amI am not quite sure of your question.The internal oscillator is not as accurate or stable as a crystal. Using the PLL will not be as stable as a crystal of the same frequency. If clock accuracy and stability are not issues, you have many options for clocking. As your clock requirements get more stringent, crystals and PLL settings should be reviewed.Hope this answered your question.paul

author: ElektroQuark
author_rank: Unknown
timestamp: February 23, 2011, 03:48:33 pm
content: Sorry.I will try again:Is there a preferred frequency due to a better production factor (or whatever) that makes an specificcrystalmore precise than others?

author: tecman
author_rank: Frequent Contributor
timestamp: February 23, 2011, 06:16:07 pm
content: Quote from: EdoNork on February 23, 2011, 03:48:33 pmThe clock frequency is a function of required performance, and in some cases a specific frequency requirement. If you are using any UART functions, the data sheet will give you data on serial clock errors based on various clock/multiplier options. Certain crystals (3.6864 MHz I believe) will give the most accurate UART frequencies. If you are doing precise counter/timer frequency or time measurements, you may want a 4 MHz for more precise timing.If neither of these are a factor, then any frequency would work. Most common is to use a 4 or 8 MHz and PLL up to a higher value. These are low cost and easy to find in many different packages.paul

author: ElektroQuark
author_rank: Unknown
timestamp: February 23, 2011, 07:30:08 pm
content: Thank you, paul.I didn't known the UART issue.