AN2687 Freescale Semiconductor / Motorola, AN2687 Datasheet - Page 41

no-image

AN2687

Manufacturer Part Number
AN2687
Description
BLDC Fan Control using the MC68HC908QT2
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
* --------------------------------------------------------------------------- *
* Subroutine <Enable external clock. For EM board>
* ICG Clock = 12.8MHz, Bus Clock = 12.8MHz/4 = 3.2MHz, 1 Cycle = 0.3125us
* In
* Out
* Call
* --------------------------------------------------------------------------- *
enable_ext_clock:
Delay1
* --------------------------------------------------------------------------- *
* Subroutine <Enable internal 3.2MHz clock. For EM board>
* ICG Clock = 12.8MHz, Bus Clock = 12.8MHz/4 = 3.2MHz, 1 Cycle = 0.3125us
* In
* Out
* Call
* --------------------------------------------------------------------------- *
en_int_3M2_clk:
* --------------------------------------------------------------------------- *
* Subroutine <Initialize the Oscillator for internal clock>
* ICG Clock = 12.8MHz, Bus Clock = 12.8MHz/4 = 3.2MHz, 1 Cycle = 0.3125us
* In
* Out
* Call
* --------------------------------------------------------------------------- *
Enable_int_Clk:
* --------------------------------------------------------------------------- *
* Subroutine <Yms Delay>
* ICG Clock = 12.8MHz, Bus Clock = 12.8MHz/4 = 3.2MHz, 1 Cycle = 0.3125us
* (((2560/2)+2+3)*6+2+3))*0.3125us = 2.41ms
* In
* Out
* Call
* --------------------------------------------------------------------------- *
Delay_Yms:
MOTOROLA
bra
bra
mov
deca
bne
bset
nop
brclr 0,$36,*
bset
rts
mov #$20,$37
mov #$2E,$38
rts
mov
lda
sta
rts
LDX #$06
:
:
:
:
:
:
:
:
:
:
:
:
<nil>
<nil>
<nil>
#18,$1E
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
Delay1
1,$36
4,$36
End_Start
*
#$00,OSCSTAT
$FFC0
OSCTRIM
Freescale Semiconductor, Inc.
BLDC Fan Control using the MC68HC908QT2
For More Information On This Product,
; For Checking only
; enable external crystal (external = $08)
; Delay 4096 cycles
; set ECGON bit
; check ECGST bit
; set this unknow bit
; turn the ICG to generated 3.2MHz bus
; use internal clock only
; use current trim value
; [2]
Go to: www.freescale.com
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
APPENDIX B: CODE LISTINGS
AN2687/D
41

Related parts for AN2687