![](http://datasheet.mmic.net.cn/120000/MC68328PV_datasheet_3559354/MC68328PV_163.png)
Phase-Locked Loop and Power Control
15-4
MC68328 USER’S MANUAL 11/10/97
MOTOROLA
PHASE-LOCKED
LOOP
3
AND
POWER
CONTROL
PRELIMINARY
15.2.2 Divider
The PLL uses a dual-modulus prescaler to reduce power consumption. This approach
divides the VCO frequency by 14 before it is fed to the rest of the divider chain. Dual-
modulus counters operate differently from other counters in that the overall divide ratio is
dependent on two separate values, P and Q. Besides the power-saving advantage, above
a divisor of 225 (decimal), every divisor is available to fine-tune the VCO in 32 kHz steps.
The formula for the dual-modulus divider is:
Divisor = 14 (P + 1) + Q + 1
Where:
1 <= Q <= 14
P >= Q + 1
Below the value of 225, some divisors are not allowed as the P and Q relationships cannot
be met.
15.2.3 Normal Startup
When the MC68328 processor is awakened from sleep mode by a system interrupt, the PLL
achieves lock within a few milliseconds. The crystal oscillator is always on after initial
powerup, so the crystal startup time is not a factor. The master clock starts operation after
the PLL achieves lock.
15.2.4 Change of Frequency
To change the VCO frequency, use the sequence below. This fragment assumes all
peripherals have been disabled and the CPU is operating at the highest possible frequency
(SYSCLK SEL = 100). NEWFREQ is the new frequency value (P and Q values) to be
programmed. This routine enables Timer 2 to wake up the PLL after two CLK32 “ticks”.
When the PLL wakes up, it will be at the new frequency. The interrupt service routine for the
temporary Timer 2 interrupt should just clear the Timer 2 interrupt and return. This code was
written for clarity, not efficiency.
NEWFREQ equ somevalue
;P and Q value of new frequency
PLLCONTROL equ $FFF200
‘PLL Control Register
PLLFREQ equ $FFFF202
;PLL Frequency Control Register
T2COMPARE equ $FFF610
;Timer 2 Compare Value Register
T2CONTROL equ $FFF60C
;Timer 2 Control Register
IMR equ $FFF304
;Interrupt Mask Register
move.1 IMR,-(SP)
;save the Interrupt Mask register
move.1 #$fffffffd,IMR
;enable ONLY Timer2 interrupt
move.w #$0001,T2COMPARE
;set compare value to 2
move.w #$0119,T2CONTROL
;enable Timer 2 with CLK32 source
SYNC
btst.b #47,PLLFREQ
;synchronize to CLK32 high level
beq.s SYNC
;CLK32 is still not high, go back
move.w #NEWFREQ,PLLFREQ
‘load the new frequency
ori.b #$8, PLLCONTROL+1
;disable the PLL (in 30 clocks)
stop #$2000
;stop, enable all interrupts
;the PLL shuts down here and waits for the Timer 2 interrupt