PDA

View Full Version : Internal Osc help



BobK
- 12th January 2007, 16:34
Hi to All,

I am using the internal oscillator for the first time on a 16F87 . The data sheet shows 8 modes of clock operation. The one that I am interested in is INTIO2. It sets up the internal osc and sets RA6 & 7 as digital I/O. I have never seen anything but INTRC_OSC used on the config setup posts on these forums.

To use this setup should my config setup be:

DEVICE 16F87 INTIO2_OSC

or would:

DEVICE 16F87 INTRC_OSC

give me the same results? The data sheet indicated that there were 4 new modes of clock operation but it really didn't cover much about INTIO2.

Thanks for any advice!

BobK

BobK
- 12th January 2007, 17:33
Hi again,

Not one to sit around I have tried this after doing somemore reading on the Special Features section of the data sheet. I changed the 16F87.INC from INTRC_OSC to INTIO2_OSC and then ran a blinking LED program on my board and it works fine.

Hope someone else can learn from this too!

BobK

Bruce
- 12th January 2007, 19:13
Hi BokK,

FYI;

INTRC_OSC_NOCLKOUT is the same as INTRC_OSC, and still the same as
INTIO2_OSC (if you've changed the constant name to this in the .INC file).
How it works is not going to change. It's still selecting the internal osc with
OCS1 & OSC2 as digital I/O-pins.

From the data sheet;

INTIO1 = (INTRC_OSC_CLKOUT) = Internal Oscillator with FOSC/4 output on
RA6 and I/O on RA7. The 1 indicates 1 I/O on RA7.

INTIO2 = (INTRC_OSC_NOCLKOUT or INTRC_OSC) = Internal Oscillator with
I/O on RA6 and RA7. The 2 indicates 2 I/O. One on RA6 & one on RA7.

Changing the name of a config fuse option in the include file does not affect
how it works. The value to the right does.

From the PBP 16F87.INC file;


INTRC_OSC_NOCLKOUT equ 3FEC0010h ; XX XXXX XXX1 XX00
INTRC_OSC equ 3FEC0010h ; XX XXXX XXX1 XX00

Note how both "constant" names are assigned the same value. You could
change one to THE_INT_RC, and it would still be the equivalent of the other.

NAME equ xxx just creates a "constant" name = to the value to the right.

Wherever the assembler encounters the name of that constant, the value
assigned to it is used. What that name is doesn't matter. Each constants
name is just to provide you with an easily recognizable name for each option.

I.E. @ DEVICE WDT_ON, INTRC_OSC_NOCLKOUT makes it easy to know at a
glance what you're getting.

BobK
- 12th January 2007, 20:43
Hi Bruce,

Thanks for the followup explanation. Why in the world does Microchip comeup with confusing things like this if it all means the same thing? I have seen other people coming up with their quirks on other things also.

Oh well.....

Thanks again, Bruce!

BobK

Bruce
- 12th January 2007, 20:50
Sometimes you just have to wonder who writes up those data sheets
ehh...;o}