AN2687 Freescale Semiconductor / Motorola, AN2687 Datasheet - Page 43

no-image

AN2687

Manufacturer Part Number
AN2687
Description
BLDC Fan Control using the MC68HC908QT2
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
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:
* --------------------------------------------------------------------------- *
* TOF_ISR - Timer Overflow Interrupt Service Routine
* In
* Out
* Call
* --------------------------------------------------------------------------- *
TOF_ISR:
MOTOROLA
sta $FFFF
nop
nop
nop
dbnza Delay_100ms_A
dbnzx Delay_100ms_X
rts
MOV
mov
MOV
MOV
MOV
MOV
MOV
MOV
BCLR
LDA
bclr
LDA
bclr
lda
bclr
rts
nop
rti
lda
bclr
rti
:
:
:
:
:
:
:
:
:
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
<nil>
; [3]
#$70,TSC
#%01000100,TSC0
#PWM_Period_H,TMODH; write overflow value to modulo registers
#PWM_Period_L,TMODL
#Duty_Cycle_H,TCH1H; write output compare value
#Duty_Cycle_L,TCH1L
#$00,TCH0H
#$00,TCH0L
5,TSC
TSC0
CH0F,TSC0
TSC1
CH1F,TSC0
TSC
TOF,TSC
TSC
TOF,TSC
Freescale Semiconductor, Inc.
BLDC Fan Control using the MC68HC908QT2
For More Information On This Product,
; [4] clear COP
; [1]
; [1]
; [1]
; [3] ;10*256=256
; [3]
; stop and reset the TIM counter, enable
; TOF interrupt, internal bus clock/1
; ch0 interrupt enable, TCH0 use as input
; capture rising edge trigger
; TOF interrupt, internal bus clock/1
; TCH0
; clear TSTOP, enable timer counter
; read TCH0 status and control register to
; clear CH0F flag
; clear CH0F flag
; read TCH1 status and control register to
; clear CH1F flag
; clear CH1F flag
; clear TOF flag
; clear TOF flag
Go to: www.freescale.com
*
*
*
*
*
*
*
*
*
*
*
*
APPENDIX B: CODE LISTINGS
AN2687/D
43

Related parts for AN2687