Thanks for the correction.
The data sheet for the 18F4550 does not have the sections you referred to.
DOH!!!
Time to check my glasses...
Thanks for the correction.
The data sheet for the 18F4550 does not have the sections you referred to.
DOH!!!
Time to check my glasses...
Dave
Always wear safety glasses while programming.
First of all thanks all of you for your replies, thoughts and guidance :-)
All postings have raised a few questions though ...
So far we know ..according to the datasheet that PLL is only available if we run at 4MHz or 8MHz and the PLL bit is enabled.Code:DEFINE OSC 8 OSCCON=%01110000 or DEFINE OSC 4 OSCCON=%01100000 OSCTUNE.6 = 1 'PLL 4x
With this in mind, if your desired frequency is either 4 or 8 MHz , you probably want to make sure that OSCTUNE.6=0 since this would disable the PLL setting.
So the above code settings for 4 or 8MHz would be as follows
And thats as per this in the datasheetCode:DEFINE OSC 8 OSCCON=%01110000 or DEFINE OSC 4 OSCCON=%01100000 OSCTUNE.6 = 0 'PLL Multiplier disabled
Am I correct ?Unlike HSPLL mode, the PLL is controlled through
software. The control bit, PLLEN (OSCTUNE<6>), is
used to enable or disable its operation.
The PLL is available when the device is configured to
use the internal oscillator block as its primary clock
source (FOSC3:FOSC0 = 1001 or 1000). Additionally,
the PLL will only function when the selected output fre-
quency is either 4MHz or 8MHz (OSCCON<6:4> = 111
or 110). If both of these conditions are not met, the PLL
s disabled.
The PLLEN control bit is only functional in those inter-
nal oscillator modes where the PLL is available. In all
other modes, it is forced to ‘0’ and is effectively
unavailable.
Kind regards
Dennis
Just another thought..
Can you achieve 20MHz then ?
Can the PLL multiplier be altered to achieve 20MHz maybe ?
Dennis
The PLL multiplyer will multiply x4 whatever your OSCILLATOR is running at. There are no other options... it's either x4 or OFF.
You need a 5MHz Crystal or Resonator if you want 20MHz using the PLL Multiplier.
The Internal Oscillator does not have 5MHz as one of it's selectable options (neither does it have 20MHz).
So if you WANT 20MHz, you'll need a 20MHz Xtal or Resonator, use HS Mode and have the PLL multiplier OFF (or 5MHz Xtal or Resonator, HS Mode and have the PLL multiplyer ON).
Section 2, Datasheet DS39631A explains it in great detail (for the 18F4520 chip) which you said you were using at the start of this thread.
Thank Melanie and everyone else who replied to this thread !
It is all CRYSTAL CLEAR now !!
:-)
Thank a million
Bookmarks