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.

PIC MICROCONTROLLEL XTAL

Status
Not open for further replies.

zia.roghani

Member level 1
Joined
Sep 13, 2006
Messages
37
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,517
#pragma config osc internal oscillator

HI all
i have started working on PIC18FXXX.
can any body help me about PRESALING XTAL
why we use this. and which reg is use to set it
and how we can use the internal XTAl of MCU

REGARDS!!!!!!!!!!!!!!!!!!!
 

pic xtal

hello.....i m having only knowledge abt mircro controllers...no idea about pic controllers..but u can get it from its datasheet. of ic..
in datasheets its mention that how much xtal range u can use with specified pic controlers.
best luck if i will find then reply you..
 

pic with internal xtal

in data sheet it iz not clear to me
i just want some body explain this with the help of example
how we use internal osc and prescaler
 

xtal capacitor value

The 18F chips have the oscillator set by the CONFIG statement.
If you explain which chip are you using and if you are using "C" or ASM I can show you how to set it.

External crystals are used rather than internal as you can go to a higher frequency and thy are more accurate for frequency.

George
 

pic xtal capacitor

i am using C AS programming language for PIC18F452

i will be really thankful if u help me solving about XTAL


thanks
 

how to connect a xtal to a pic

The 18F452 is an older chip and Microchip recommends use of 18F4520 to replace it.
The 18F452 does not have an internal oscillator. Your best bet is to get a xtal and connect as per data sheet.
If you can not get an xtal or external osc then you will need to get a resistor and capacitor and hook up as per data sheet under section "2.3 RC Oscillator"
Ther is a chart in section 23-12 and 23-13 that show the frequency vs resistor capacitor value.
For example 3.3K resistor and 20pf capacitor will yield a 3.5 meg osc.
Max osc is 4.0 meg.

I am more familiar with assembler but looking up examples
it appears the code below sets the oscillator.

Uncoment and use the following for type needed.
For example "#pragma config OSC" = RC for RCoscillator.

//#pragma config OSC = LP //Oscillator Selection:LP
//#pragma config OSC = XT //Oscillator Selection:XT
//#pragma config OSC = HS //Oscillator Selection:HS
//#pragma config OSC = RC //Oscillator Selection:RC
//#pragma config OSC = EC //Oscillator Selection:EC-OSC2 as Clock Out
//#pragma config OSC = ECIO //Oscillator Selection:EC-OSC2 as RA6
//#pragma config OSC = HSPLL //Oscillator Selection:HS-PLL Enabled
//#pragma config OSC = RCIO //Oscillator Selection:RC-OSC2 as RA6

Hope this helps

George
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top