16F688 Internal clock and MCLR


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2006
    Location
    Isle of Man
    Posts
    32

    Cool 16F688 Internal clock and MCLR

    Using tips from this forum my 16F188 program starts with the following code:

    CMCON0=%0000111 'Comparators off. (NOTE: CMCON=7 does not work!)
    OSCCON.3=1 'Use internal clock. NOTE: PIC defaults to this, even if not specified!

    The device is then programmed with the oscillator configured as INTOSCIO and the MCLR pin function as RESET.

    Now 2 questions: First, how do I ensure that the internal clock is 8MHz and not 32KHz? Second, is the usual MCLR pullup resistor still needed, since the datasheet indicates that the 16F688 has an internal one? My circuit starts and runs OK with or without one.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    At the beginning of the program.
    Code:
    DEFINE OSC 8
    If MCLR is set for External the usual RC applies.
    If MCLR is set for Internal then the pin becomes an input.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Feb 2006
    Location
    Isle of Man
    Posts
    32


    Did you find this post helpful? Yes | No

    Cool

    Thanks for the speedy reply. I'll set the clock as you suggest.

    With the MeLABS programmer the options are MCLR Pin Function = Reset or =Input Pin. Do you mean that the programmer should be configured with this pin as an Input Pin to make the internal MCLR pull up active? To minimise components I want to avoid having to use an external 4.7K resistor. Sorry not be be entirely clear!

  4. #4
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    The 16F688 datasheet says it defaults to 4MHz after reset so you need to set OSCCON for 8MHz. You also need to wait until the oscillator is stable. See the OSCCON section of the datasheet for details.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by manxman View Post
    With the MeLABS programmer the options are MCLR Pin Function = Reset or =Input Pin. Do you mean that the programmer should be configured with this pin as an Input Pin to make the internal MCLR pull up active? To minimise components I want to avoid having to use an external 4.7K resistor. Sorry not be be entirely clear!
    Sorry, I can not help with that one as I do not use a MeLABS programmers.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Setting up internal clock correctly?
    By JohnM in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th March 2008, 20:29
  2. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  3. External clock
    By Firegod in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th March 2007, 00:53
  4. Why does the clock stop?
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 29th May 2006, 15:36
  5. What does this MCLR instruction mean?
    By bartman in forum General
    Replies: 16
    Last Post: - 30th November 2004, 00:32

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