P1c18f26k20-internal clock set up fail -64mhz


Closed Thread
Results 1 to 17 of 17

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: P1c18f26k20-internal clock set up fail -64mhz

    try osccon.1 =1
    failing that post your code and tell us what version of pbp you are using

  2. #2
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: P1c18f26k20-internal clock set up fail -64mhz

    This could help.

    Name:  Capture.PNG
Views: 770
Size:  35.2 KB

    OSCCON 6:4 need setting for 16 MHZ which is $70, which is what you have.
    OSCTUNE 6 needs setting to connect internal oscillator to 4xPLL $40, which you have.

    Looking at the Internal Oscillator Block OSCCON 1:0 have an effect and from the datasheet.

    bit 1-0 SCS<1:0>: System Clock Select bits
    1x = Internal oscillator block
    01 = Secondary (Timer1) oscillator
    00 = Primary clock (determined by CONFIG1H[FOSC<3:0>]).

    which tells me, if I understand correctly, that OSCCON 1 needs setting. Which is what Richard said.

    Which now makes OSCCON $72.

    Last there is config1H for HSPLL and HFINTOSC/PLL

    _FOSC_HSPLL_1H EQU H'F6' ; HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1)
    _FOSC_INTIO67_1H EQU H'F8' ; Internal oscillator block, port function on RA6 and RA7
    _FOSC_INTIO7_1H EQU H'F9' ; Internal oscillator block, CLKOUT function on RA6, port function on RA7

    which I leave to you or others to explain, I use boot loader and never used configs.

  3. #3
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Angry Re: P1c18f26k20-internal clock set up fail -64mhz

    THANSKS alot for your help.

    yes, i try

    OSCCON = $72,
    OSCTUNE = $40
    the problem still persises.
    portb.6 lost power. but it runs faster
    -------------------------------------------------------------------------------
    here is the conf.
    __CONFIG _CONFIG1H, _FOSC_INTIO7_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H' __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    OSCCON = $72,
    OSCTUNE = $40
    -----------------------------------------------------------------------------
    portb = 0
    latb = 0
    trisb = 0
    ----------------------------------------------------
    about the SCS it is automatic set to 00- becasue in the CONFI_1h --- FOSC_INRIO67- (IT IS determined by primary osc in the 1H line)
    here is the explaination in the data sheet
    ------------------------------------------============
    2.9.1 SYSTEM CLOCK SELECT
    (SCS<1:0>) BITS
    The System Clock Select (SCS<1:0>) bits of the
    OSCCON register select the system clock source that
    is used for the CPU and peripherals.
    • When SCS<1:0> = 00, the system clock source is
    determined by configuration of the FOSC<2:0>
    bits in the CONFIG1H Configuration register.
    • When SCS<1:0> = 10, the system clock source is
    chosen by the internal oscillator frequency
    selected by the INTSRC bit of the OSCTUNE
    register and the IRCF<2:0> bits of the OSCCON
    register.
    • When SCS<1:0> = 01, the system clock source is
    the 32.768 kHz secondary oscillator shared with
    Timer1.
    After a Reset, the SCS<1:0> bits of the OSCCON
    register are always cleared.
    -----------------------------------------------------------
    the version, of pbp. it is 2.6c
    i read the post of: http://www.microchip.com/forums/m730158.aspx-
    also mentioned the same issue- but the PLLCFG is not recognized in the PBP

    thanks for your concern,
    regards

  4. #4
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: P1c18f26k20-internal clock set up fail -64mhz

    Very interesting thanks.

    Yes one of the settings that worked in the above link is.

    __CONFIG _CONFIG1H, _FOSC_INTIO67_1H
    OSCCON = $70
    OSCTUNE = $40

    Is that not what you started with?

  5. #5
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default Re: P1c18f26k20-internal clock set up fail -64mhz

    Y]hello,

    yes the above is work.
    ..
    osccon = $70 or (60)
    osctune = $40

    for single leds
    i move to drive 595 then there r problem- lost power or low speed @ out put

    now i try to clean the pbp to see waht happen'

    thenak for your help.
    regards

  6. #6
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default Re: P1c18f26k20-internal clock set up fail -64mhz

    HI ALL,

    the pic run well @ 4mhz ,HSPLL; 8, 10mhz ... problem (HSPLL).

    the conf. remains unchanged

    __CONFIG _CONFIG1H, _FOSC_HSPLL_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L

    where is the problem?
    thanks all for your help
    regards

  7. #7
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: P1c18f26k20-internal clock set up fail -64mhz

    Quote Originally Posted by MINHLE View Post
    the conf. remains unchanged

    __CONFIG _CONFIG1H, _FOSC_HSPLL_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L

    where is the problem?
    thanks all for your help
    regards
    The conf. has changed from #4
    here is the conf.
    __CONFIG _CONFIG1H, _FOSC_INTIO7_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H' __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    also you said

    yes the above is work.
    ..
    osccon = $70 or (60)
    osctune = $40

    for single leds
    i move to drive 595 then there r problem- lost power or low speed @ out put
    If it works for single leds then it works and all of your code needs checking. So please post your code so we can help.

Similar Threads

  1. 18F26K22 - Unable to get 64MHz Internal clock speed
    By Balachandar in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th July 2014, 17:53
  2. How to set the internal CPU speed?
    By Ramius in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th April 2011, 21:04
  3. UberNewbie can't set his clock...
    By Byte_Butcher in forum General
    Replies: 19
    Last Post: - 7th January 2009, 05:22
  4. external clock / internal clock
    By grounded in forum General
    Replies: 4
    Last Post: - 31st May 2008, 18:44
  5. How to set internal oscillator on 16F88
    By newgeppetto in forum Off Topic
    Replies: 0
    Last Post: - 3rd December 2005, 10:28

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