Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Query about PLL and Oscillator of PIC18F4550

Status
Not open for further replies.

born4elex

Junior Member level 1
Joined
Aug 9, 2009
Messages
16
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
india
Activity points
1,369
Hi all
I want to use PIC18F4550 for my project. I want to do serial communication with PIC18F4550.
I am totally new to PIC's. I dont know how to configure PLL and oscillator in PIC18F4550.
Can anybody give me a brief tutorial on PLL and Oscillator of PIC18F4550 ?
 

You have a lot of options. Before you start to configure your device, you must be able to answer these questions:

Which clock source are you planning to use? External or internal?
What are your speed requirements?
What is the serial communication speed? (I assume it's not USB, which limits the speed options you can choose)
 

Thanks a lot for such a quick reply,
I want to use 16Mhz clock speed. If it has an internal oscillator then how to enable it and how i can multiply this frequency upto 16MHz with the help of PLL ?
 

Unfortunately the internal oscillator can't be boosted by the PLL to achieve 16 MHz. Its maximum speed is 8 MHz.

For 16 MHz, you still have more than one options:

Without using PLL, you can use 16, 32, 48 or 64 MHz XTAL directly, by adjusting the oscillator postscaler to 1, 2, 3 or 4 respectively. This done by the configuration bits CPUDIV0 and CPUDIV1 during the programming of the device. Also, "HS Oscillator" option must be chosen by the configuration bits FOSC3:FOSC0.

With using PLL, you can use 4, 8, 12, 16, 20, 24, 40 or 48 MHz XTALs. As the PLL only accepts 4 MHz input, PLL Prescaler configurations bits PLLDIV2:pLLDIV0 must be configured accordingly during the programming. Also, 96 MHz output of the PLL must be divided by 6 to achieve 16 MHz clock, which is done by adjusting the PLL Postscaler via CPUDIV1:CPUDIV0. And of course, HSPLL or XTPLL option must be chosen by the configuration bits FOSC3:FOSC0. Don't use XTPLL unless you have a 4 MHz XTAL.

For more information about the configuration bits, see the "Special Features of the CPU" section in the datasheet. Also the Figure 2-1 in the "Oscillator Configurations" section summarizes the possible configurations.

Note: I'm not sure if the XTALs I mentioned above are available on the market. But I guess it shouldn't be a problem to find 4 or 16 MHz ones.
 

Tagli said:
Unfortunately the internal oscillator can't be boosted by the PLL to achieve 16 MHz. Its maximum speed is 8 MHz.

For 16 MHz, you still have more than one options:

Without using PLL, you can use 16, 32, 48 or 64 MHz XTAL directly, by adjusting the oscillator postscaler to 1, 2, 3 or 4 respectively. This done by the configuration bits CPUDIV0 and CPUDIV1 during the programming of the device. Also, "HS Oscillator" option must be chosen by the configuration bits FOSC3:FOSC0.

With using PLL, you can use 4, 8, 12, 16, 20, 24, 40 or 48 MHz XTALs. As the PLL only accepts 4 MHz input, PLL Prescaler configurations bits PLLDIV2:pLLDIV0 must be configured accordingly during the programming. Also, 96 MHz output of the PLL must be divided by 6 to achieve 16 MHz clock, which is done by adjusting the PLL Postscaler via CPUDIV1:CPUDIV0. And of course, HSPLL or XTPLL option must be chosen by the configuration bits FOSC3:FOSC0. Don't use XTPLL unless you have a 4 MHz XTAL.

For more information about the configuration bits, see the "Special Features of the CPU" section in the datasheet. Also the Figure 2-1 in the "Oscillator Configurations" section summarizes the possible configurations.

Note: I'm not sure if the XTALs I mentioned above are available on the market. But I guess it shouldn't be a problem to find 4 or 16 MHz ones.

Your post contain many mistakes/technical issues.


born4elex, use a 16MHz xtal (HS) directly and there is no need to think about PLL. Just leave it.

Note one thing if you are an AVR programmer, 16Mhz in PIC means 4MIPS and 48Mhz means 12MIPS and it is not possible to operate PIC18F4550 above 48Mhz.
If you need 16MIPS see the below page:

https://www.microchipdirect.com/Chart.aspx?branchId=1004&mid=10&treeid=1


You must read datasheet to know more about clock/oscillator selection.

Good Luck.
 

Thank you to both Tagli and anandpv2009,
I'll try it by simply connecting 16Mhz crystal to its Xtal pins.
 

hi, i got the same problem. but i have to run my micro on 16MHz . i am using 24fj128ga010. i want to use intenal FRC and i am not able to initialize it.i have configured the configuration bits using the _CONFIG micro and used the following code. pls help me.

__builtin_write_OSCCONH(0x78);
__builtin_write_OSCCONH(0x9a);
_NOSC2=0;
_NOSC1=0;
_NOSC0=1;
__builtin_write_OSCCONL(0x46);
__builtin_write_OSCCONL(0x57);
_OSWEN=1;
temp_cnt=0;
while(_OSWEN)
{
temp_cnt++;
if(temp_cnt>65534){temp_cnt=0;}
}
 

C30, are you sure? You are not suposed too... With pic18Fs you should use C18... I dont know if MPLAB allow you to compile with a different compiler..
 

i hv mentioned that i m using pic24fj128ga010. pls read my post.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top