INT OSC PIC16f88

Oct 16, 2005 6 Replies

Hi, I'm trying to set up internal oscillator with 16f88... I want to use the "led blink" Mikropascal

formatting link
sample program, so i 've only added this instruction: OSCCON:=$7E; //Internal 8Mhz clock



Is it right ? I made a simply breadboard with only these connections



5: gnd
14: Vcc
10(on any pin of PortB) diode to GND. are they enough ?

The PIC seems to be died... nothing is happening... IcProg tell me that all is OK and i can read program from it...



Mikropascal

formatting link
compilers.htm)

I move 0x70 to OSCCON

You should use a resistor to limit current thru the LED.

What about pin 4 (MCLR)? It should be tied to Vcc unless it is specifically disabled by the CONFIG word created by your compiler.

If you can program it, then it's probably capable of running. Try connecting pin 4 to Vcc. Also, the nanowatt PICs are somewhat more picky about supply voltage rise time and noise.

>

thank for your replay, why 0x70 ? Yes i have a 220ohm R Pin 4 ? I want to use it for digital input isn't it possible ? How can i configure it ? I use IcProg.

That is just the value that I use and it works for me. Some of the bits you are setting are really set by the hardware when the clock becomes stable etc..

Ok that should be fine.

I don't know anything about using IcProg since I use a Picall programmer. To configure pin 4 as an input you have to have the MCLRE bit in CONFIG word 2 cleared. In MPASM I would specify _MCLR_OFF in my _CONFIG directive. I don't know how you would do that with the compiler you are using. Perhaps IcProg will allow you to manually specify the value.

oh, i see...

another question: what is the difference between OSCCON.SCS Oscillator Mode Select bits:

10 = Internal RC is used for system clock and 00 = Oscillator mode defined by FOSC

thanks

To get the complete answer, you'll have to read the datasheet. "00" says to use the _CONFIG1 word to determine the clock source. "00" is the value that is always loaded after a RESET (such as power on). I suppose that there are cases where someone might want to switch from say an external clock source to the internal oscillator, and that would be a sensible time for changing the SCS bits to "10". Since the PIC powers on with the SCS bits at "00" and you are wishing to use the internal oscillator block only, I recommend you keep it set to "00".

The datasheet is somewhat confusing on all this stuff. Your _CONFIG1 word should contain _INTRC_IO or _INTRC_CLKOUT as the clock type.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required