AN2687 Freescale Semiconductor / Motorola, AN2687 Datasheet - Page 30

no-image

AN2687

Manufacturer Part Number
AN2687
Description
BLDC Fan Control using the MC68HC908QT2
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2687/D
* --------------------------------------------------------------------------- *
* Subroutine <Initialization : Configure Registers and Bus Clock>
* In
* Out
* Call
* --------------------------------------------------------------------------- *
START:
* --------------------------------------------------------------------------- *
* Subroutine <Initialization : RAM>
* In
* Out
* Call
* --------------------------------------------------------------------------- *
ClrRAM
ClearRAM:
* --------------------------------------------------------------------------- *
* Subroutine <Initialization : I/O, Timer, ADC>
* In
* Out
* Call
* --------------------------------------------------------------------------- *
* Init the I/Os
* Initialize the Timer module
* Initialize the ADC module
* --------------------------------------------------------------------------- *
* Subroutine <Main + Startup Phase>
* In
* Out
* Call
* --------------------------------------------------------------------------- *
30
SEI
ldhx
txs
mov
mov
BSET
jsr
sta
ldhx
clr
aix
cphx
bne
clr
mov
MOV
MOV
JSR
:
:
:
:
:
:
:
:
:
:
:
:
<nil>
<nil>
enable_int_clk
RamStart
<nil>
<nil>
<nil>
<nil>
Init_TIM_ICAP
irq_Flag, icap_Flag
Start_Flag
Delay_100ms
#$FF+1
#%00111001,CONFIG1 ; disable COP,LVI disable, disable STOP, long COP rate
#%01000000,CONFIG2 ; RST pin function disable, select int. oscillator,
2,INTSCR
enable_int_clk
$ffff
#RamStart
,x
#1
#RamLast+1
ClearRAM
PTA
#%00111000,DDRA
#$40,ADICLK
#$21,ADSCR
Init_TIM_ICAP
Freescale Semiconductor, Inc.
BLDC Fan Control using the MC68HC908QT2
For More Information On This Product,
; initialize
; the stack pointer
; IRQ enable at PTA2 with internal pull-up
; CLEAR IRQF
; enable ICG for device only
; CLEAR COP
; point to start of RAM
; clear RAM location
; advance pointer
; done ?
; loop back if not
; PTA3,PTA4,PTA5 as output
; PTA2 = input only pin
; timer init. with TCH0 as input capture
; rising edge trigger
; ADC CLOCK = BUSCLOCK / 4 = 0.8MHz with
; 12.8MHz ICG
; Interrupt disable, Continous conversion,
; PTA1 = ADC1
Go to: www.freescale.com
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
MOTOROLA

Related parts for AN2687