-
16F1827 - Slow Clock
Apparently there is something I do not see. And is 3.30 am...
The following settings make the PIC run at 1/4 the speed it is supposed to.
Code:
#config
__config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_ON & _CPD_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
__config _CONFIG2, _WRT_OFF & _PLLEN_ON & _LVP_OFF & _STVREN_OFF ;& _BORV_25
#endconfig
DEFINE OSC 32
If I set the DEFINE OSC at 8 then the speed is as expected. But the above config is for 8 x 4 PLL = 32MHz...
Where am I wrong?
Ioannis
-
Re: 16F1827 - Slow Clock
osccon=$70
or
& _PLLEN_OFF
osccon=$F0
also
it takes a little time for pll to stabilise
while !oscstat.6 : wend ;wait for pll ready
-
Re: 16F1827 - Slow Clock
Hmm, I did OSCCON=$F0 but at the same time & _PLLEN_ON.
Does it matter?
Ioannis
-
Re: 16F1827 - Slow Clock
you would think not , but I have been using mplabx/mcc mostly lately and for some chips it does indeed matter it seems.
soft selecting pll always works so that's what i'm used to doing ,
-
Re: 16F1827 - Slow Clock
And it does work as expected!
Thanks Richard.
Ioannis