buy hot The Fixer cool video Year One download Kasabian album nice Terminator Salvation hit cool track Jordin Sparks USA Whatever Works video download Check My Brain melodies nice video Finding Nemo nice Pop - Various Artists hit cheap DIVX Year One

digital-diy.com

Swordfish Code Snippet - External Oscillator and PLL Print E-mail
( 1 Vote )
  
Saturday, 04 April 2009 10:15

pic18f452_T1

The fastest a 16F PIC micro can run is 5 Million Instructions Per Second (MIPS), almost every 18F PIC micro can run at 10 MIPS, some more. Here's an extract from an 18F datasheet;


"The HSPLL mode makes use of the HS mode oscillator

for frequencies up to 10 MHz. A PLL then multiplies the

oscillator output frequency by 4 to produce an internal

clock frequency up to 40 MHz."


But how exactly to we enable this PLL feature so our PIC can run 4 times faster than usual? Its simple with a higher language Development suit like Swordfish,

Device = 18F458
Clock = 40
Config OSC = HSPLL
 
// Start Of Program...

 

The above code is simply the start of the program. OSC = HSPLL enables the High Speed (HS) PLL feature, but there are some limitations to take into account.

 

Remember that the PIC usually executes an instruction once every 4 oscillator cycles, with PLL, it can be reduced t a 1:1, that is, one oscillation = 1 instruction. With this in mind, and the PIC's max speed (10 MIPS), the greatest external crystal that can be used is 10Mhz. If you compared the speed to a PIC running normally, it would be that of a PIC running with a 40Mhz crystal. That is why the Clock setting is declared as 40Mhz, allowing the compiler to generate the right delays etc when required.

 

Some 18F PIC's can operate at 48Mhz (12 MIPS), check the datasheet for more information about the PIC your using.

Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
Security
Please input the anti-spam code that you can read in the image.
Last Updated ( Tuesday, 14 April 2009 10:47 )
 

Whos Online

  • andyo
  • Jon Chandler

Forum Activity