OSCON setting for 18F4520


Closed Thread
Results 1 to 9 of 9

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    DEFINE OSC 8
    OSCCON=%01110000

    or
    DEFINE OSC 4
    OSCCON=%01100000


    OSCTUNE.6 = 1 'PLL 4x
    does not do PLL. As far as I know PLL is not possible with the internal OSC.

    The other OSCON bits leave at zero, they are for reading.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    .... As far as I know PLL is not possible with the internal OSC.
    From the datasheet (DS39631A):
    2.5.2 PLL AND INTOSC
    The PLL is also available to the internal oscillator block
    in selected oscillator modes. In this configuration, the
    PLL is enabled in software and generates a clock output
    of up to 32 MHz.

    2.6.4 PLL IN INTOSC MODES
    The 4x frequency multiplier can be used with the internal
    oscillator block to produce faster device clock
    speeds than are normally possible with an internal
    oscillator. When enabled, the PLL produces a clock
    speed of up to 32 MHz.
    Unlike HSPLL mode, the PLL is controlled through
    software. The control bit, PLLEN (OSCTUNE<6>), is
    used to enable or disable its operation.

    The PLL is available when the device is configured to
    use the internal oscillator block as its primary clock
    source (FOSC3:FOSC0 = 1001 or 1000). Additionally,
    the PLL will only function when the selected output frequency
    is either 4 MHz or 8 MHz (OSCCON<6:4> = 111
    or 110). If both of these conditions are not met, the PLL
    is disabled.
    The PLLEN control bit is only functional in those internal
    oscillator modes where the PLL is available. In all
    other modes, it is forced to ‘0’ and is effectively
    unavailable.

Similar Threads

  1. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 15:01
  2. PWM setting PIC16F887
    By Gevo in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th June 2008, 08:24
  3. code size VS speed optimization setting?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th April 2008, 15:38
  4. Setting up the oscillator
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd October 2007, 15:53
  5. Help with setting adcon1 for 16f877
    By jessey in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 16th August 2005, 12:13

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