HCS12 PLL activation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HCS12 PLL activation

1,867 Views
Andik
Contributor I
Hello,

I would like to put this question to this plenum:
Is it possible to engage PLL when no osc and no clock is available (the MCU is in self-clock mode)? I suppose, that this is not possible.

And, next question, PLL can get the reference clocks from osc, can be referenced by clock connected to EXTAL too? My attempt to get this working is not successful.

I'm using clock of 5MHz on EXTAL and code from DRM:

void PLLINIT() {
CLKSEL &= ~BM_PLLSEL; // make sure PLL is *not* in use
PLLCTL |= BM_PLLON+BM_AUTO;// enable PLL module, Auto Mode
REFDV = S12_REFDV; // set up Reference Divider
SYNR = S12_SYNR; // set up Synthesizer Multiplier
while((CRGFLG & BM_LOCK) == 0) ;// wait until PLL is locked
CLKSEL |= BM_PLLSEL; // switch over to PLL clock
}

Any constructive reply will be appreciated.
Thanks.
Labels (1)
0 Kudos
1 Reply

403 Views
rhinoceroshead
Contributor I

I'm not sure I understand your first question...  Are you asking if it's possible to use the 'self clock' as the PLL reference clock?  That would be impossible.  The 'self clock' is the signal that comes out of the PLL when no reference is applied to it.  It is not accurate for measuring real time.

Your second question...  That seems to me like it should be possible, but I haven't tried it.

0 Kudos