Freescale Semiconductor DRM079 Manuel d'utilisateur Page 28

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 34
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 27
Implementation
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
28 Freescale Semiconductor
sta KBIES ;HALL rising Edge Trigger
sta KBIPE ;KBI Enable
;-------------------------------------------------------
;Config MTIM
;
;Timer prescalar=256 -> Timer clk = 16kHz
;Bus = 4MHz
;Max OF period = 16.384ms
;Timer resolution = 64us
;-------------------------------------------------------
mov #(MTIM_BUS_CLK|MTIM_DIV_256), MTIMCLK
mov #255, MTIMMOD
;-------------------------------------------------------
;Motor Start Sequence
;-------------------------------------------------------
ResetPosition:
mov #mPWM1, PTAD ; Lock FAN in reset position
lda #30 ;
Dly1 bsr Delay ; for Delay 0.5s
dbnza Dly1 ;
clr PTAD ; de-energize coils
bsr Delay
; Drive L2
ldx #mPWM2 ; Select L2 Coils
bsr SetPWM ; Drive coil
bsr Delay ; De-energize coils
inc MotorRunning ; otherwise Update Software flag
;-------------------------------------------------------
;Fan Control Loop
;-------------------------------------------------------
FanControlLoop:
;1) Drive L1 coil
clr KBIES ; HALL falling edge trigger
ldx #mPWM1 ; Select L1 Coil
bsr SetPWM ; Drive coil
;2) Read Temp Sensor
jsr ReadSensor ; Read Sensor value
;3) Dead time control
StartTimer ; Wait dead time period
wait
mov #(mMTIMSC_TSTP|mMTIMSC_TRST), MTIMSC; mask interrupt and clear flag
;4) Drive L2 coil
bset HALL, KBIES ; HALL rising edge trigger
ldx #mPWM2 ; Select L2 Coil
bsr SetPWM ; Drive coil
Vue de la page 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 34

Commentaires sur ces manuels

Pas de commentaire