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.

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

Status
Not open for further replies.

baby_1

Advanced Member level 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"
A Phase Locked Loop circuit is provided as a programmable
option for users that want to multiply the frequency
of the incoming crystal oscillator signal by 4.
For an input clock frequency of 10 MHz, the internal
clock frequency will be multiplied to 40 MHz. This is
useful for customers who are concerned with EMI due
to high frequency crystals.

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?
 

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.
 
  • Like
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

#include <p18f452.h>
#include <delays.h>
#include <stdio.h>
#include "xlcd.h"


#pragma config OSC=HSPLL
#pragma config WDT=OFF
#pragma config BOR=OFF
#pragma config LVP=OFF
#pragma config PWRT=ON
#define lcd PORTDbits.RD3
#define but PORTDbits.RD2



unsigned int cont = 0 ;
char buf[20];

void main(void)
{
TRISDbits.RD3=0;

while(1)
{
lcd=1;
Delay1KTCYx(10);
lcd=0;
Delay1KTCYx(10);
}
}


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:

o_O

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...
 
  • Like
Reactions: baby_1

    baby_1

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

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top