Internal Osc help


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352

    Smile Internal Osc help

    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

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    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

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    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;
    Code:
    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.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    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

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Sometimes you just have to wonder who writes up those data sheets
    ehh...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Internal vs. external osc for comms
    By mtripoli in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th January 2010, 14:58
  2. 16F88 bootlader with Internal OSC
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 2nd August 2009, 10:15
  3. 18F4520 and internal osc & PLL
    By pwhitt in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2008, 06:38
  4. Internal Osc question.
    By muddy0409 in forum General
    Replies: 4
    Last Post: - 31st August 2008, 17:01
  5. 12f675 internal osc question.....
    By Gabe@SPdFtsh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th January 2004, 06:33

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts