
I have added a 32768Hz crystal to the OSC in and out pins (PORTA6,7) with 12pF to ground each side.
I can't get it to work, I am looking at the pins with a 'scope. I am missing something but can't see what.
Device=18F26K22
Xtal=64
Config_Start
FOSC = INTIO67 ;Internal oscillator block, port function on RA6 and RA7
PLLCFG = On ;Oscillator multiplied by 4
PRICLKEN = On ;Primary clock is always enabled
FCMEN = OFF ;Fail-Safe Clock Monitor disabled
IESO = OFF ;Oscillator Switchover mode disabled
PWRTEN = OFF ;Power up timer disabled
BOREN = OFF ;Brown-out Reset disabled in hardware and software
BORV = 285 ;VBOR set to 2.85 V nominal
WDTEN = OFF ;Watch dog timer is always disabled. SWDTEN has no effect.
WDTPS = 1 ;1:1
CCP2MX = PORTB3 ;CCP2 input/output is multiplexed with RB3
PBADEN = OFF ;Segments<5:0> pins are configured as digital I/O on Reset
HFOFST = OFF ;HFINTOSC output and ready status are delayed by the oscillator stable status
T3CMX = PORTB5 ;T3CKI is on RB5
P2BMX = PORTC0 ;P2B is on RC0
MCLRE = EXTMCLR ;MCLR pin enabled, RE3 input pin disabled
STVREN = On ;Stack full/underflow will cause Reset
LVP = OFF ;Single-Supply ICSP disabled
XINST = OFF ;Instruction set extension and Indexed mode disabled (Legacy mode)
Debug = OFF ;Disabled
Cp0 = OFF ;Block 0 (000800-001FFFh) not code-protected
Config_End
OSCCON = Percent01110000 ;16MHz internal oscillator block
Nop
OSCCON2 = Perecnt 10001100 ;pre-scaler to give 64Megs
Nop
Set OSCTUNE.6 ;enable PLL so clock now 64MHz
T3CON = Percent10001100 ;osc on timer 3, no prescale, no sync
TMR3H = $80 ;set for 1 second (count of 32768)
TMR3L = $00
T3CON = Percent10001101 ;enable soc/timer
While ;loop-stop
Wend
Tried different crystals etc, the device works otherwise.
Any help appreciated.
Charlie