Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Setting frequency of internal clock source

Status
Not open for further replies.

chris414

New Member
I'm trying to set the internal clock to 8Mhz instead of the default 1Mhz. Is it acceptable practice to simply say:

Code:
OSCCON =  0b01110000;

or is there a better way?
 
Last edited:
I'm using a PIC18F2550. Bits 6-4 determine the oscillator speed, ranging from 1Mhz to 8Mhz (for the internal oscillator). To change from the default 1Mhz setting to 8Mhz, is that the "proper" way to do it?
 
I'm trying to set the internal clock to 8Mhz instead of the default 1Mhz.
or is there a better way?

According to my reading of the data sheet, the internal oscillator block is set at 8 Mhz:


2.2.5 INTERNAL OSCILLATOR BLOCK
The PIC18F2455/2550/4455/4550 devices include an
internal oscillator block which generates two different
clock signals; either can be used as the microcontroller’s
clock source. If the USB peripheral is not used, the
internal oscillator may eliminate the need for external
oscillator circuits on the OSC1 and/or OSC2 pins.
The main output (INTOSC) is an 8 MHz clock source
which can be used to directly drive the device clock. It
also drives the INTOSC postscaler which can provide a
range of clock frequencies from 31 kHz to 4 MHz. The
INTOSC output is enabled when a clock frequency

from 125 kHz to 8 MHz is selected.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top