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.

[SOLVED] 18F4520 Internal Oscillator

Status
Not open for further replies.

hactic

Newbie level 5
Joined
Aug 26, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,335
Hi, I have questions about 18F4520 internal oscillator calibration and set up.

1. Do you have to set it up every time you will be programming or will it be set to a default value of 8MHz?

2. Does it have to be calibrated every time or the factory calibration will do?

I did refer to the data sheets but could not fully understand whether these 2 things have to be done every time you'll be writing some code and storing it in the chip.

Appreciate someone's guidance. Thanks.
 

Hi,

No, never done that, use the 4520 regularly, its accurate enough for virutually all needs without further tweaking.

Just specify Osccon at the beginning of your Main code to select the frequency you require if its not the default 1 mhz.

movlw b'01100010' ; SET INTERNAL OSC TO 4 Mhz
movwf OSCCON


111 = 8 MHz (INTOSC drives clock directly)
110 = 4 MHz
101 = 2 MHz
100 = 1 MHz(3) 3 - DEFAULT
011 = 500 kHz
010 = 250 kHz
 
  • Like
Reactions: hactic

    hactic

    Points: 2
    Helpful Answer Positive Rating
If you having a new code every time, you have to specify the required frequency in your code. Or if not specified it will assume the default 1MHz, as wp100 said.
 
  • Like
Reactions: hactic

    hactic

    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