Freescale Semiconductor DRM079 #HIGH613NVICSTRM, Pagesel, MAPADDR6NVFTRIM, Icssc, #ICSDIV2, ICSC2

Page 27

Temperature Sensor Measurement

TargetPeriod ds.b 1

ActualPeriod ds.b 1

DriveTime ds.b 1

SensorReading ds.b 1

MotorRunning ds.b 1

org RAMStart ; variable/data section

org ROMStart

;code section main:

Entry:

;-------------------------------------------------------

;Config ICS

;Device is pre-trim to 16MHz ICLK frequency

;TRIM value are stored in $3FFA:$3FFB

;-------------------------------------------------------

#HIGH_6_13(NV_ICSTRM), PAGESEL

 

mov

; $3FFB

mov

MAP_ADDR_6(NV_FTRIM), ICSSC

mov

MAP_ADDR_6(NV_ICSTRM), ICSTRM ; $3FFA

mov

#ICS_DIV_2, ICSC2

; Use 4MHz

;-------------------------------------------------------

 

;Config System

 

 

;-------------------------------------------------------

#HIGH_6_13(SOPT), PAGESEL

; Init Page register

mov

mov

#(mSOPT_COPTmSOPT_STOPE), MAP_ADDR_6(SOPT)

mov

 

; BKGD disable, COP disabled

#(mSPMSC1_LVDEmSPMSC1_LVDRE), MAP_ADDR_6(SPMSC1); LVI enable

mov

#(RTI_128MS), MAP_ADDR_6(SRTISC) ; 128ms RTI

;-------------------------------------------------------

 

; Init RAM

 

 

;-------------------------------------------------------

#MaxDeadTime, DeadTime

 

mov

; 1000 rpm

mov

#232, TargetPeriod

mov

#232, ActualPeriod

; 1000 rpm

clr

SensorReading

 

clr

MotorRunning

 

;-------------------------------------------------------

 

; Config GPIO

 

 

; RC - init L

 

 

; Buzzer - init L

 

; PWMn/PWMp - init L

 

;-------------------------------------------------------

PTAD

; Initial low

clr

mov

#(mRCmPWM1mPWM2), PTADD

; Set Output pins

;-------------------------------------------------------

 

; Config KBI

 

 

;-------------------------------------------------------

#mHALL

 

lda

 

 

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

 

 

Freescale Semiconductor

27

Image 27
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 Chapter Motor Control CommutationRotor Position Control Speed Control Commutation WaveformsMotor Startup Fault DetectionFreescale Semiconductor Block Diagram Chapter ImplementationHardware Resources Control Loop Firmware Control Loop = V DD⎜ RC⎟ Temperature Sensor Measurement#63, Mtimmod ACMPSCACF, AcmpscAcmpsc 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