16F1827 - Slow Clock


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795

    Default 16F1827 - Slow Clock

    Apparently there is something I do not see. And is 3.30 am...

    The following settings make the PIC run at 1/4 the speed it is supposed to.

    Code:
    #config
      __config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_ON & _CPD_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
      __config _CONFIG2, _WRT_OFF & _PLLEN_ON & _LVP_OFF & _STVREN_OFF ;& _BORV_25
    #endconfig
    
    DEFINE OSC 32
    If I set the DEFINE OSC at 8 then the speed is as expected. But the above config is for 8 x 4 PLL = 32MHz...

    Where am I wrong?

    Ioannis

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,380


    Did you find this post helpful? Yes | No

    Default Re: 16F1827 - Slow Clock

    osccon=$70


    or

    & _PLLEN_OFF


    osccon=$F0


    also


    it takes a little time for pll to stabilise

    while !oscstat.6 : wend ;wait for pll ready
    Last edited by richard; - 22nd June 2018 at 03:44.
    Warning I'm not a teacher

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795


    Did you find this post helpful? Yes | No

    Default Re: 16F1827 - Slow Clock

    Hmm, I did OSCCON=$F0 but at the same time & _PLLEN_ON.

    Does it matter?
    Ioannis

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,380


    Did you find this post helpful? Yes | No

    Default Re: 16F1827 - Slow Clock

    you would think not , but I have been using mplabx/mcc mostly lately and for some chips it does indeed matter it seems.
    soft selecting pll always works so that's what i'm used to doing ,
    Warning I'm not a teacher

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795


    Did you find this post helpful? Yes | No

    Default Re: 16F1827 - Slow Clock

    And it does work as expected!

    Thanks Richard.

    Ioannis

Similar Threads

  1. Misbehaving HPWM on 16F1827
    By J. Mark Wolf in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 20th January 2012, 01:32
  2. 16F1827 Errata
    By Ioannis in forum General
    Replies: 0
    Last Post: - 23rd March 2011, 22:42
  3. 16F1827 setup
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 10th March 2011, 00:04
  4. 16F1827 ASM Interrupt
    By abbtech in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th February 2011, 07:47
  5. 16F1827 voltage issue
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th January 2011, 13:42

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