MC68HC908GT16_07 FREESCALE [Freescale Semiconductor, Inc], MC68HC908GT16_07 Datasheet - Page 89

no-image

MC68HC908GT16_07

Manufacturer Part Number
MC68HC908GT16_07
Description
Microcontrollers
Manufacturer
FREESCALE [Freescale Semiconductor, Inc]
Datasheet
7.4.1 Switching Clock Sources
The key point to remember in this flow is that the clock source cannot be switched (CS cannot be written)
unless the desired clock is on and stable. A short assembly code example of how to employ this flow is
shown in
;* Clock Switching Code Example
;* This code switches from internal to external clock
;* Clock monitor and interrupts are not enabled
;*
SwitchItoE:
7.4.2 Enabling the Clock Monitor
Many applications require the clock monitor to determine if one of the clock sources has become inactive,
so the other can be used to recover from a potentially dangerous situation. Using the clock monitor
requires both clocks to be active (ECGON and ICGON both set). To enable the clock monitor, both clocks
also must be stable (ECGS and ICGS both set). This is to prevent the use of the clock monitor when a
clock is first turned on and potentially unstable.
Enabling the clock monitor and clock monitor interrupts requires a flow similar to this:
These events must happen in sequence. A short assembly code example of how to employ this flow is
shown in
Freescale Semiconductor
ICG Clock Switch
Switching from one clock source to another requires both clock sources to be enabled and stable.
A simple flow requires:
Enable desired clock source
Wait for it to become stable
Switch clocks
Disable previous clock source
Enable the alternate clock source
Wait for both clock sources to be stable
Switch to the desired clock source if necessary
Enable the clock monitor
Enable clock monitor interrupts
Figure
Figure
bset
brclr
bset
bclr
7-9.
7-10.
MC68HC908GT16 • MC68HC908GT8 • MC68HC08GT16 Data Sheet, Rev. 5.0
ECGON,ICGCR
ECGS,ICGCR,*
CS,ICGCR
ICGON,ICGCR
Figure 7-9. Code Example for Switching Clock Sources
; turn on external oscillator
; wait until external clock engaged
; select external clock for bus
; turn off internal clock (if desired)
Usage Notes
89

Related parts for MC68HC908GT16_07