English
Language : 

MC68HC908RF2 Datasheet, PDF (135/254 Pages) Motorola, Inc – HCMOS Microcontroller Unit
Internal Clock Generator Module (ICG)
Usage Notes
start lda
cmp
lda
add
sta
lda
store
exit
ldx
mul
rola
rolx
bcc
rorx
inc
stx
lda
cmp
bhi
lda
sta
jmp
jmp
;DDIV and DSTG modification code example
;Changes DDIV and DSTG according to the initial and
; desired clock period values
;Requires ICGON to be clear (disabled)
;User must previously calculate DVFACT and STFACT by
; the equations listed in the specification
;Modifies X and A registers
icgcr ;Verify ICGON clear (this will require
#13
; CMIE,CMF,CMON,ICGON,ICGS clear and CS,ECGON,ECGS set)
#dvfact ;Add the DDIV factor (calculated before
icgdvr ; coding by the DDIV2 equation)
icgdvr
#stfact ;Load the DSTG factor (calculated before coding and
; multiplied by 128 to make it 0-255 for maximum precision
icgdsr ;Load current stage register contents
;Multiply factor times current value
;Since factor was multiplied by 128,
; result is x6-x0:a7, so put it all in X
store ;If result is >255, rolx will set carry
; so divide result by two and
; add one to DDIV
icgdsr ;Store value
icgdvr ;Test to see if DDIV too high or low
#09
;Valid range 0-9; too low is FF/FE; too high is 0A/0B
exit
;If DDIV is 0-9, you’re almost done
#09
;Otherwise, maximize period and execute error code
icgdvr
error
enable ;Jump to code which turns on desired
;clock, clock monitor, interrupts, etc.
Figure 8-9. Code Example for Writing DDIV and DSTG
8.5.8 Trimming Frequency on the Internal Clock Generator
The unadjusted frequency of the low-frequency base clock (IBASE),
when the comparators in the frequency comparator indicate zero error,
will vary as much as ±25 percent due to process, temperature, and
voltage dependencies. These dependencies are in the voltage and
current references, the offset of the comparators, and the internal
capacitor. The voltage and temperature dependencies have been
designed to be a maximum of approximately ±1 percent error. The
process dependencies account for the rest.
MC68HC908RF2 — Rev. 1
MOTOROLA
Internal Clock Generator Module (ICG)
Advance Information
135