CAn't get PLL to work on 18LF4620


Closed Thread
Results 1 to 7 of 7
  1. #1

    Default CAn't get PLL to work on 18LF4620

    I cannot get the PLL to turn on. I can set the INTRC oscillator to 4 MHz or 8 MHz but I cannot get the 4x PLL to activate. I have scoured the forum but found nothing directly relevant.
    MCS+ 3.0.0.5 PBP 2.60L MPASM v5.37

    I want to get an internal RC clock of 16 or 32MHz so then I can push the DEBUG speed up.

    Code:
    '************ Config Register setup for USB programmer *************
    ' OSC = INTIO2,  FSCM = En, IESO = En, PwrupTmr = En, BrownOut = Dis
    ' BOR Volts = 2, WDT = Off, WDTPS = 1:512, CCP2 mux = RB3, 
    ' PortB reset = Digital, LPT1Osc = Low, MCLR = Reset, LVP = Disabled
    ' Enhanced CPU = Dis, All memory = Not Protected
    '*******************************************************************
    DEFINE OSC 4               'IntOsc <= 32MHz @ 3.7V OK. See page 325.
    DEFINE DEBUG_REG PORTB     'Debug output pin port 
    DEFINE DEBUG_BIT 6         'Debug output pin bit (= PGC)
    DEFINE DEBUG_BAUD 28800    'Debug baud rate 
    DEFINE DEBUG_MODE 0        'Debug mode: 0 = True, 1 = Inverted 
    'DEFINE DEBUG_PACING 50    'Debug character pacing in us 
    
    
    '   OSCCON = %01101111        ' Select 4 MHz
       OSCCON = $62               ' also selects 4 MHz 
    '   OSCCON = %01111111        ' Select 8 MHz
    '   OSCTUNE = %01000000       'PLL ON, at centre frequency
       OSCTUNE.6 = 1              ' PLL ON   
    '   OSCTUNE = %00000000       'PLL OFF, at centre frequency
    Any help gratefully received.
    BrianT

  2. #2
    Join Date
    Jul 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    I dunno OSCTUNE, but modifying the .INC file usually work for me

    You have 2 choices for PPL, but I think if you use 4mhz it would be "normal" speed.

    here is my config for a 18F2550, using 20Mhz xtal, so this has to be high speed mode(HS)

    ; __CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    ; __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H

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


    Did you find this post helpful? Yes | No

    Default

    Give this a shot
    Code:
    @ __CONFIG    _CONFIG1H, _OSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    @ __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    @ __CONFIG    _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
    @ __CONFIG    _CONFIG4L,  _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    
    DEFINE OSC 32
    
    OSCCON = %01110000
    OSCTUNE = %01000000
    Dave
    Always wear safety glasses while programming.

  4. #4


    Did you find this post helpful? Yes | No

    Default ERROR Overwriting previous address contents

    Thanks Dave,
    I pasted your lines of code into my program but now I get a slew of
    "ERROR Overwriting previous address contents" messages. Not sure how to handle this.

    Cheers
    BrianT

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


    Did you find this post helpful? Yes | No

    Default

    When setting the configs in code space you need to modify the *.inc file for the chip in the PBP directory. Comment out the configs there. Or just modify the *.inc with the new configs.
    http://www.picbasic.co.uk/forum/cont...o-your-Program
    Dave
    Always wear safety glasses while programming.

  6. #6


    Did you find this post helpful? Yes | No

    Default Will stick with USB Programmer fuse settings

    Thanks Dave but changing the .inc file is more pain than gain.

    This little project has three 18F4620. One uses IntIO2 at 4 MHz which is where I want to activate the PLL, another uses HS with a crystal at 20 MHz and the third uses XT with a crystal at 4 MHz. It is easier to just change the Config fuses on the MeLabs USB serial programmer.

    Cheers
    Brian

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


    Did you find this post helpful? Yes | No

    Default

    Thanks Dave but changing the .inc file is more pain than gain.
    That is why I comment the *.inc and set the fuses in code space.

    But did you get it working like you want?
    Dave
    Always wear safety glasses while programming.

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