AN2687 Freescale Semiconductor / Motorola, AN2687 Datasheet - Page 33

no-image

AN2687

Manufacturer Part Number
AN2687
Description
BLDC Fan Control using the MC68HC908QT2
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
* --------------------------------------------------------------------------- *
* Subroutine <100ms Delay>
* ICG Clock = 12.8MHz, Bus Clock = 12.8MHz/4 = 3.2MHz, 1 Cycle = 0.3125us
* ((2560+2+3)*128+2+3)*0.3125us = 102.6ms
* In
* Out
* Call
* --------------------------------------------------------------------------- *
Delay_100ms:
Delay_100ms_X
Delay_100ms_A
* --------------------------------------------------------------------------- *
* Subroutine <Configure TIMER module as Input Capture for channel 0 (PTA0)>
* In
* Out
* Call
* --------------------------------------------------------------------------- *
Init_TIM_ICAP:
* --------------------------------------------------------------------------- *
* DMY_ISR - dummy Interrupt Service Routine (with no operation)
* In
* Out
* Call
* --------------------------------------------------------------------------- *
DMY_ISR:
MOTOROLA
LDX #$7C
LDA #$FF
sta $FFFF
nop
nop
nop
dbnza Delay_100ms_A
dbnzx Delay_100ms_X
rts
MOV
mov
MOV
MOV
BCLR
LDA
bclr
lda
bclr
rts
nop
rti
:
:
:
:
:
:
:
:
:
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
; [3]
#$30,TSC
#%01000100,TSC0
#$00,TCH0H
#$00,TCH0L
5,TSC
TSC0
CH0F,TSC0
TSC
TOF,TSC
Freescale Semiconductor, Inc.
BLDC Fan Control using the MC68HC908QT2
For More Information On This Product,
; [2]
; 20ms:
; 100ms: X=#$7C or (#128)
; 200ms: X=#$FA or (#250)
; [2]
; [4] clear COP
; [1]
; [1]
; [1]
; [3] ;10*256=256
; [3]
; stop and reset the TIM counter, disable
; TOF interrupt, internal bus clock/1
; ch0 interrupt enable, TCH0 use as input
; capture rising edge trigger
; output low at TCH0
; clear TSTOP, enable timer counter
; read TCH0 status and control register to
; clear CH0F flag
; clear CH0F flag
; clear TOF flag
Go to: www.freescale.com
X=#$19 or (#25)
*
*
*
*
*
*
*
*
*
*
*
*
*
*
APPENDIX B: CODE LISTINGS
AN2687/D
33

Related parts for AN2687