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
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
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