Timing of heartbeat LED is off


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Timing of heartbeat LED is off

    osccon = ( IRCF << 3) | SCS

    might work
    Warning I'm not a teacher

  2. #2
    Join Date
    Aug 2011
    Posts
    455


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Timing of heartbeat LED is off

    First off, you should use CON to define a numeric constant instead of DEFINE

    Next, since the intosc defaults to 500KHz at startup, that's outside the range of the 4xPLL which is spec'd from 4MHz-8MHz.
    While it might work, I'd leave the CONFIG setting for the PLL off and enable it when you change the osc freq

    Something like this should work:
    Code:
    #CONFIG
     __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF 
     __CONFIG _CONFIG2, _WRT_OFF & _VCAPEN_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_LO & _LVP_OFF
    #ENDCONFIG
    
    DEFINE OSC 32
    ' OSCCON register settings
    SPLLEN CON %1           ' PLL enable
    IRCF   CON %1110        ' to enable 8 MHz
    SCS    CON %00          ' system clock determined by FOSC
    
    OSCCON = (SPLLEN<<7) | (IRCF<<3) | SCS

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: Timing of heartbeat LED is off

    Thanks guys. I've been away for far too long.

    Tumbleweed's code worked on the first try.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Timing out DT's Blinking Led
    By tazntex in forum General
    Replies: 3
    Last Post: - 28th May 2010, 17:41
  2. LED Bargraph chip (guitar LED bling-age) ..do with a PIC?
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 12th July 2009, 23:15
  3. Heartbeat LED
    By ecoli-557 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th March 2009, 14:05
  4. Replies: 3
    Last Post: - 5th December 2008, 15:00
  5. LED timing
    By elen-group in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th June 2008, 10:51

Members who have read this thread : 0

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