Freescale Semiconductor DRM079 manual Kbisc, BUZZER, Ptad, #6, Mtimmod, #24, Mtimmod

Page 31

 

 

Temperature Sensor Measurement

NoReading:

#$00, SensorReading

; Smallest Number

mov

clr

ACMPSC

; disable ACMP

mov

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

mov

#(MTIM_BUS_CLKMTIM_DIV_256), MTIMCLK; Reset Timer resolution

rts

 

 

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

;6-bit Table Lookup ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TableLookup:

bset SRTISC_RTIACK, MAP_ADDR_6(SRTISC);5

mov

#HIGH_6_13(TableStart), PAGESEL;5 Calculate the PAGE

lda

SensorReading

;3

add

#$c0

;2 Reference to paging window

tax

,x

;2

lda

;3

sta

TargetPeriod

;2

mov

#HIGH_6_13(SOPT), PAGESEL

;5

rts

 

;3

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

;Error Handling

;Stop the motor

;Sound the buzzer (about 520Hz) ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MotorHang:

clr

PTAD

; clear

PWMp and PWMn

lda

MotorRunning

; Check

software flag

bne

SoundBuzzer

; =1, Motor is running

jmp

ResetPosition

 

 

SoundBuzzer:

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

mov

clr

KBISC

; mask KBI

lda

#255

; Bump COP

sta

MAP_ADDR_6(SRS)

Beep:

BUZZER, PTAD

; a 20%

duty cycle loop

bset

; Drive

buzzer

mov

#6, MTIMMOD

 

Reset and Start Timer

mov

#(mMTIMSC_TRSTmMTIMSC_TOIE), MTIMSC;

wait

#(mMTIMSC_TSTPmMTIMSC_TRST), MTIMSC;

mask interrupt and clear flag

mov

sta

MAP_ADDR_6(SRS)

; Bump COP

bclr

BUZZER, PTAD

; Clear

buzzer

mov

#24, MTIMMOD

 

Reset and Start Timer

mov

#(mMTIMSC_TRSTmMTIMSC_TOIE), MTIMSC;

wait

#(mMTIMSC_TSTPmMTIMSC_TRST), MTIMSC;

mask interrupt and clear flag

mov

sta

MAP_ADDR_6(SRS)

 

; Bump COP

dbnza

Beep

 

 

 

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

 

 

 

Freescale Semiconductor

 

31

Image 31
Contents Variable Speed DC Fan Control using the MC9RS08KA2 Page Revision History Variable Speed DC Fan Control using the MC9RS08KA2Freescale Semiconductor Table of Contents Freescale Semiconductor Introduction Chapter IntroductionDC Fan Reference Design Targets Freescale’s New Generation Ultra Low Cost MCUBi-Phase Bldc Motor Diagram Bi-Phase Bldc MotorFreescale Semiconductor Commutation Chapter Motor ControlRotor Position Control Speed Control Commutation WaveformsMotor Startup Fault DetectionFreescale Semiconductor Chapter Implementation Block DiagramHardware Resources Control Loop Firmware Control Loop = V DD⎜ RC⎟ Temperature Sensor MeasurementACMPSCACF, Acmpsc #63, MtimmodAcmpsc Temperature Conversion Temperature Conversion Table Freescale Semiconductor VR1 Freescale Semiconductor Appendix B Program Listing Acmpoutputboth RtidisableMtimtclkfalling Mtimtclkrising#ICSDIV2, ICSC2 #HIGH613NVICSTRM, PageselMAPADDR6NVFTRIM, Icssc MAPADDR6NVICSTRM, Icstrm $3FFA#255, Mtimmod KbiesKbipe #MTIMBUSCLKMTIMDIV256, MtimclkRts Drive coil MAPADDR6SRSMTIMSCTOF, Mtimsc KBISCKBACK, Kbisc#24, Mtimmod KbiscBUZZER, Ptad #6, Mtimmod#30, Mtimmod Page How to Reach Us