Implementation

lda

#255

 

Quiet:

BUZZER, PTAD

; Clear buzzer

bclr

mov

#30, MTIMMOD

 

mov

#(mMTIMSC_TRSTmMTIMSC_TOIE), MTIMSC; Reset and Start Timer

wait

#(mMTIMSC_TSTPmMTIMSC_TRST), MTIMSC; mask interrupt and clear flag

mov

sta

MAP_ADDR_6(SRS)

; Bump COP

dbnza

Quiet

 

bra

SoundBuzzer

 

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

;Lookup Table ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

org TableStart

dc.b

57,

57,

57,

57,

57,

60,

63,

67,

71,

76,

82,

82,

88,

88,

96,

96

dc.b

105,105,115,115,115,128,128,128,128,144,144,144,144,165,165,165

dc.b

165,193,193,193,193,193,232,232,232,232,232,232,232,232,232,232

dc.b

232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

;Reset Vector ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

org $3ffc Security:

dc.b $FF

jmp main

Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0

32

Freescale Semiconductor

Page 32
Image 32
Freescale Semiconductor DRM079 manual #30, Mtimmod