Freescale Semiconductor DRM079 manual MAPADDR6SRS, Rts Drive coil

Page 29

 

 

 

Temperature Sensor Measurement

;5) Read Temp Sensor Again

 

; Read Sensor value

bsr

ReadSensor

 

;6) Dead time control

 

 

StartTimer

 

 

;7) During the dead time, update dead time period every 128ms

brclr

SRTISC_RTIF, MAP_ADDR_6(SRTISC), UpdateLater; Update PWM duty cycle

jsr

TableLookup

 

 

UpdateLater:

ActualPeriod

 

 

lda

; Actual-Target

 

sub

TargetPeriod

 

blo

IncPeriod

; if same, Fan speed reach target then exit

beq

WaitAgain

DecPeriod:

DeadTime

; if bigger, decrement DeadTime

lda

 

 

cmp

#MinDeadTime

 

 

blo

WaitAgain

 

 

dec

DeadTime

 

 

bra

WaitAgain

 

 

IncPeriod:

DeadTime

; if smaller, increment DeadTime

lda

 

 

cmp

#MaxDeadTime

 

 

bhs

WaitAgain

 

 

inc

DeadTime

 

 

bra

WaitAgain

 

 

WaitAgain:

 

 

 

;8) Bump COP

MAP_ADDR_6(SRS)

; Bump COP

sta

wait

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

mov

;9) Repeat the control cycle

bra FanControlLoop

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

;Delay 16ms ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Delay:

mov

#255, MTIMMOD

; OF period

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

rts

 

 

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

;Drive coil

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

Freescale Semiconductor

29

Image 29
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 Rotor Position Control Chapter Motor ControlCommutation Speed Control Commutation WaveformsMotor Startup Fault DetectionFreescale Semiconductor Hardware Resources Block DiagramChapter Implementation Control Loop Firmware Control Loop = V DD⎜ RC⎟ Temperature Sensor MeasurementAcmpsc #63, MtimmodACMPSCACF, Acmpsc Temperature Conversion Temperature Conversion Table Freescale Semiconductor VR1 Freescale Semiconductor Appendix B Program Listing Mtimtclkfalling RtidisableMtimtclkrising AcmpoutputbothMAPADDR6NVFTRIM, Icssc #HIGH613NVICSTRM, PageselMAPADDR6NVICSTRM, Icstrm $3FFA #ICSDIV2, ICSC2Kbipe Kbies#MTIMBUSCLKMTIMDIV256, Mtimclk #255, MtimmodRts Drive coil MAPADDR6SRSMTIMSCTOF, Mtimsc KBISCKBACK, KbiscBUZZER, Ptad Kbisc#6, Mtimmod #24, Mtimmod#30, Mtimmod Page How to Reach Us