Author Topic: PIC18F 48MHz clock or better  (Read 14520 times)

0 Members and 1 Guest are viewing this topic.

Offline AcHmed99Topic starter

  • Contributor
  • Posts: 35
  • Country: 00
PIC18F 48MHz clock or better
« on: April 27, 2011, 12:13:24 pm »
I'
« Last Edit: November 28, 2016, 06:35:14 pm by AcHmed99 »
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: PIC18F 48MHz clock or better
« Reply #1 on: April 27, 2011, 05:00:57 pm »
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?
« Last Edit: April 27, 2011, 05:04:39 pm by scrat »
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: PIC18F 48MHz clock or better
« Reply #2 on: April 27, 2011, 07:20:26 pm »
The 18F25K20 can use an external 16 MHz and the 4x PLL multiplier to operate at 64 MHz.

 

Offline johnmx

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: pt
Re: PIC18F 48MHz clock or better
« Reply #3 on: April 27, 2011, 08:10:11 pm »
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.
Best regards,
johnmx
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: PIC18F 48MHz clock or better
« Reply #4 on: April 27, 2011, 09:34:27 pm »
I've never used an 18F before just 10F's through to 16F's. My understanding from the data sheet is that the PLL can only be used with the internal RC oscillator.

It 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.
 

Offline johnmx

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: pt
Re: PIC18F 48MHz clock or better
« Reply #5 on: April 27, 2011, 09:45:32 pm »
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 MHz

So 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.
Best regards,
johnmx
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: PIC18F 48MHz clock or better
« Reply #6 on: April 28, 2011, 12:10:37 am »
As from the datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/41303G.pdf at 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)
« Last Edit: April 28, 2011, 09:06:10 am by scrat »
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline ziq8tsi

  • Regular Contributor
  • *
  • Posts: 80
Re: PIC18F 48MHz clock or better
« Reply #7 on: April 28, 2011, 01:55:29 am »
External clock at 16MHz, PLL 4x (EC/ECIO + PLL, not specified in the table, but schematic says it's possible)

There 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.
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: PIC18F 48MHz clock or better
« Reply #8 on: April 28, 2011, 09:06:25 am »
External clock at 16MHz, PLL 4x (EC/ECIO + PLL, not specified in the table, but schematic says it's possible)

There 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.


Yes, 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)
« Last Edit: April 28, 2011, 09:08:43 am by scrat »
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 810
  • Country: gb
Re: PIC18F 48MHz clock or better
« Reply #9 on: April 28, 2011, 11:56:39 am »
The internal clock has a precision of +/-1 %. I dont recall the drift over time and temperature.

If 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.
« Last Edit: April 28, 2011, 12:01:19 pm by Leo Bodnar »
 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: PIC18F 48MHz clock or better
« Reply #10 on: April 29, 2011, 09:34:47 am »
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)

The fixed 48Mhz clock is entirely due to the USB module.

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: PIC18F 48MHz clock or better
« Reply #11 on: April 29, 2011, 03:50:53 pm »
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)

The fixed 48Mhz clock is entirely due to the USB module.

Yes, but that clock is also usable as the CPU and CCPWM peripheral one.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf