Running led blink at 64mhz with 18f26k22.


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    29

    Default Running led blink at 64mhz with 18f26k22.

    I have used the 12f628 for a long time and have moved on to the 18f26k22 for more horsepower. I am using the code below to blink an LED, but it blinks far slower than 500ms. In the programmer dropdowns, the PLL is enabled, but to what multiplier? Sould the OSCCAL be set to 16mhz with an x4 PLL or is the OSCCON set to 64mhz? Its a little confusing. I want to run at 64mhz on the internal OSC.

    Thanks

    Jason

    Code:
    define OSC 64
    DEFINE OSCCAL_1K 1
    LED VAR PORTB.0 
     
    mainloop:
    High LED 
    Pause 500 
    Low LED 
    Pause 500 
    Goto mainloop 
     
    End

  2. #2
    Join Date
    Feb 2009
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: Running led blink at 64mhz with 18f26k22.

    Got it!

    Code:
    define OSC 64
    DEFINE OSCCAL_1K 1
    OSCCON=%01110000
    OSCTUNE=%11000000
    LED    VAR  PORTB.0  
     
    mainloop:
       High LED        
       Pause 500       
       Low LED         
       Pause 500       
       Goto mainloop   
     
       End

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Running led blink at 64mhz with 18f26k22.

    Great Job!!!
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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