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.

Configuration bits?

Status
Not open for further replies.

RedCore

New Member
Hello everyone.
I'm wondering how the configuration bits work..

One of the website I visit has tutorial that does something like this:
__config 0x3D18 ;sets the configuration settings
;(oscillator type etc.)

I convered this to binary: 11110100011000
The datasheet lists 3 configuration bits for the oscillator.
FOSC0-2

I'm thinking this is the last part of that binary. If this is the case then the config line in the tutorial would have the chip use INTRC, the internal clock.
This is what i want for my first program. (Note: I dont have my PIC or Programmer yet)

My question is simply.. Am I at all correct?

Also, I'm using "PicFlash" to program my PIC and there is something it calls
ID locations. What are these and do they have any relevance to this?
and If i'm correct about the configuration bits. Should I set my oscillator in PicFlash to RC?

Thanks guys.
 
RedCore said:
Hello everyone.
One of the website I visit has tutorial that does something like this:
__config 0x3D18 ;sets the configuration settings
;(oscillator type etc.)

I convered this to binary: 11110100011000
The datasheet lists 3 configuration bits for the oscillator.
FOSC0-2

I'm thinking this is the last part of that binary. I

Fosc1 and Fosc0 are the least significant bits in the configuartion word, Fosc2 is usually bit 4. Check the datasheet of your PIC (which one are you using?)

Also, you might try the configuration labels.
Device configuration.
 
I'm use the PIC16F877. I'm wanting to use the Internal clock and not have to mess with any external clock. The datasheet lists what every bit of the configuration word does but there is nothing about INTRC. The MicroChip reference manual for their midrange chips mentioned a FOSC2 and used that to set it. Any clue as to how i can get this PIC to run off its internal clock?
bit 1-0 FOSC1:FOSC0: Oscillator Selection bits
11 = RC oscillator
10 = HS oscillator
01 = XT oscillator
00 = LP oscillator
 
Hi,
The 16F877 does not have an internal osc. The RC refers to an external Resistor/Capacitor circuit.
Get a copy of the 16F877 datasheet from www.microchip.com

The Config word is very important.

If you are using MPLAB as your compiler it has examples and headers that show how to use the Config statements.

Is this clear ?
 
The PIC16F877 comes with my programmer, I just havent recieved it yet.
Parts of the datasheet talk as if there is an internal OSC, but the datasheet contains a few variant of the chip also.

I also order the PIC18F4550, and PIC18F4520. Maybe not the best idea, as I have not even looked at thier datasheet to se how complicated they are.

Thanks for the help tho guys.. Looks like I'm going to have to have and EXT OSC.
 
Status
Not open for further replies.

Latest threads

Back
Top