what is HS/PLL in PIC and use it in Mplab

Status
Not open for further replies.

baby_1

Advanced Member level 1
Joined
Dec 3, 2010
Messages
415
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
4,277
Hello
i use PIC18f452 and want to work with all features.as you know micro divide the input frequency to lower frequency for example if we put a 4Mhz crystal it works with 1Mhz.today i see something new in the 18f452 datasheet

"HS/PLL"

it means if i put a 2Mhz crystal micro can use 4mhz and doesn't divide to 4?

if yes how can i use this features in Mplab C?
 


Hi,

Using 4Mhz Crystal with PLL mutlipies the frequence by 4 so giving an oscillator of 16Mhz.

The Pic then divides the 16Mhz by 4 to give it a Clock frequency of 4Mhz. ( which would be 1Mhz if you did not use the PLL)

You amend your CONFIG code to _HSPLL_OSC

Edit
It will probably work with a 2Mhz crystal but normally intended to be used with 4Mhz and above.
 
Reactions: baby_1

    baby_1

    Points: 2
    Helpful Answer Positive Rating
Hello and Thanks
i tested some code and find the configuration of PLL Oscillator (#pragma config OSC=HSPLL)
here is my code



i checked the ouput with oscilloscope but when i use
#pragma config OSC=HSPLL
or
#pragma config OSC=HS

both of them they show me the same result(output frequency 50hz)!!!!!!!!!!!
why?
 

I can only say:



but are you sure you make a complete Power-up Cycle???
The PLL doesn't work right after programming the fuses... You need to turn power off.. and then turn power on...

The same to disable it...
 
Reactions: baby_1

    baby_1

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…