PIC18F 48MHz clock or better - Page 1
Forum section: electronics / general

author: AcHmed99
author_rank: Contributor
timestamp: April 27, 2011, 12:13:24 pm
content: I'

author: scrat
author_rank: Frequent Contributor
timestamp: April 27, 2011, 05:00:57 pm
content: PIC18F with USB peripheral like PIC18F2550 accept up to 48 MHz external clock, they divide up to /12 and then obtain a 48MHz clock from the internal PLL.I now see on the datasheet that PIC18F26K20 works with external clock (EC mode) at 64MHz (see page 374).However, why would you need such a high clock? Doesn't the PLL maintain the clock precision of a lower frequency clock?

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: April 27, 2011, 07:20:26 pm
content: The 18F25K20 can use an external 16 MHz and the 4x PLL multiplier to operate at 64 MHz.

author: johnmx
author_rank: Frequent Contributor
timestamp: April 27, 2011, 08:10:11 pm
content: Running the PIC18F26K20 at 64MHz you can use its Capture module to measure time with a resolution of 62.5ns. The 1% precision of the internal clock is completely despicable if you are going to measure a very low period.

author: Rufus
author_rank: Super Contributor
timestamp: April 27, 2011, 09:34:27 pm
content: Quote from: AcHmed99 on April 27, 2011, 09:10:57 pmIt sounds like you have barely looked at the datasheet. A block diagram of the oscillator section clearly shows the x4 PLL can be driven from the external oscillator. The ten different oscillator modes are documented and The AC timing characteristics section defines external clock and PLL timing requirements.In EC mode you can supply a clock up to 64MHz (48MHz for extended temperature range parts). HS mode supports crystals up to 25MHz or 16MHz if the PLL is used. A 16MHz crystal is the simplest way to get a 64MHz clock and 62.5ns resolution for the timers.

author: johnmx
author_rank: Frequent Contributor
timestamp: April 27, 2011, 09:45:32 pm
content: The PLL can be used in any of the following conditions:• When the primary clock is HSPLL• When the primary clock is HFINTOSC and the selected frequency is 16 MHz• When the primary clock is HFINTOSC and the selected frequency is 8 MHzSo just use a 16MHz crystal (HSPLL mode) if you don’t want to use the internal RC.Alternatively, you can use an external oscillator running at 64MHz (EC mode), but this option is more expensive.

author: scrat
author_rank: Frequent Contributor
timestamp: April 28, 2011, 12:10:37 am
content: As from the datasheethttp://ww1.microchip.com/downloads/en/DeviceDoc/41303G.pdfat page 27 (figure 2-1) and 385 (table 26-6), and as stated above by rufus, running at 64MHz can be achieved by:External clock at 16MHz, PLL 4x (EC/ECIO + PLL, not specified in the table, but schematic says it's possible)External clock at 64MHz, no PLL (EC/ECIO)Quartz at 16MHz, PLL 4x (HSPLL)Internal oscillator at 16MHz, PLL 4x (HFINTOSC + PLL)

author: ziq8tsi
author_rank: Regular Contributor
timestamp: April 28, 2011, 01:55:29 am
content: Quote from: scrat on April 28, 2011, 12:10:37 amThere is definitely no ECPLL mode. All sixteen bit patterns for FOSC<3:0> in CONFIG1H are defined, and none of them enable EC input and PLL simultaneously.You can use an external 16MHz crystal with PLL, or an external 64MHz clock without.

author: scrat
author_rank: Frequent Contributor
timestamp: April 28, 2011, 09:06:25 am
content: Quote from: ziq8tsi on April 28, 2011, 01:55:29 amYes, you're right! Edited above to correct this. Now it's like johnmx stated.An alternative is PIC18F2550/4550, which let you use the PLL (which is much more flexible) with external clock generators at many multiples of 4MHz (but result in a fixed 48MHz clock)

author: Leo Bodnar
author_rank: Frequent Contributor
timestamp: April 28, 2011, 11:56:39 am
content: Quote from: AcHmed99 on April 27, 2011, 06:45:37 pmIf you want to have extremely flexible PLL settings have a look at dsPIC33 series or some PIC24. They have fully adjustable division and multiplication PLL coefficients.

author: metalphreak
author_rank: Frequent Contributor
timestamp: April 29, 2011, 09:34:47 am
content: Quote from: scrat on April 28, 2011, 09:06:25 amThe fixed 48Mhz clock is entirely due to the USB module.

author: scrat
author_rank: Frequent Contributor
timestamp: April 29, 2011, 03:50:53 pm
content: Quote from: metalphreak on April 29, 2011, 09:34:47 amYes, but that clock is also usable as the CPU and CCPWM peripheral one.