PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Dec 17, 2009 2:21 pm |
|
|
When you use the Internal oscillator with the PLL, the only possible
oscillator frequencies are 16 MHz or 32 MHz. There's a schematic
in the 18F4520 data sheet, in the Oscillator section. It shows that
only the 4 MHz and 8 MHz outputs from the internal oscillator can
drive the 4x PLL. So, 4x4 = 16 MHz, and 8x4 = 32 MHz.
If you have a modern version of the compiler, you can set it up
very simply. Just specify internal oscillator in the #fuses and
specify 16 or 32 MHz in the #use delay(). The compiler will set
it up to use the PLL, automatically.
Code: | #include <18F4520.h>
#fuses INTRC_IO,NOWDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay(clock=16000000)
//===============================
main(void)
{
while(1);
} |
If this doesn't work, then post your compiler version.
(Always post it in your initial post, to save time). |
|