mc68hc908kx8 Freescale Semiconductor, Inc, mc68hc908kx8 Datasheet - Page 78

no-image

mc68hc908kx8

Manufacturer Part Number
mc68hc908kx8
Description
M68hc08 Microcontrollers
Manufacturer
Freescale Semiconductor, Inc
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
mc68hc908kx8CDW
Manufacturer:
FSC
Quantity:
364
Part Number:
mc68hc908kx8CDW
Manufacturer:
FREESCALE
Quantity:
20 000
Part Number:
mc68hc908kx8CDWE
Manufacturer:
FREESCALE
Quantity:
20 000
Company:
Part Number:
mc68hc908kx8CDWE
Quantity:
588
Part Number:
mc68hc908kx8MDWE
Manufacturer:
MOT
Quantity:
6 238
Company:
Part Number:
mc68hc908kx8VP
Quantity:
13
Internal Clock Generator Module (ICG)
7.4.1 Switching Clock Sources
Switching from one clock source to another requires both clock sources to be enabled and stable. A
simple flow requires:
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
particular assembler.
start
loop
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
must also 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 the one below:
These events must happen in sequence. A short assembly code example of how to employ this flow is
shown in
particular assembler.
78
1. Enable desired clock source
2. Wait for it to become stable
3. Switch clocks
4. Disable previous clock source
1. Enable the alternate clock source
2. Wait for both clock sources to be stable
3. Switch to the desired clock source if necessary
4. Enable the clock monitor
5. Enable clock monitor interrupts
lda
**
sta
cmpa
bne
Figure
Figure
7-8. This code is for illustrative purposes only and does not represent valid syntax for any
7-9. This code is for illustrative purposes only and does not represent valid syntax for any
#$13
**
icgcr
icgcr
loop
MC68HC908KX8 • MC68HC908KX2 • MC68HC08KX8 Data Sheet, Rev. 2.1
Figure 7-8. Code Example for Switching Clock Sources
;Clock Switching Code Example
;This code switches from Internal to External clock
;Clock Monitor and interrupts are not enabled
;Mask for CS, ECGON, ECGS
; If switching from External to Internal, mask is $0C.
;Other code here, such as writing the COP, since ECGS may
; take some time to set
;Try to set CS, ECGON and clear ICGON. ICGON will not
; clear until CS is set, and CS will not set until
; ECGON and ECGS are set.
;Check to see if ECGS set, then CS set, then ICGON clear
;Keep looping until ICGON is clear.
Freescale Semiconductor

Related parts for mc68hc908kx8