Freescale Semiconductor DRM079 manual Appendix B Program Listing

Page 25

Temperature Sensor Measurement

Appendix B.

Program Listing

;**************************************************************

;

;(c) copyright Freescale Semiconductor. 2006

;ALL RIGHTS RESERVED

;

;**************************************************************

;**************************************************************

;* DC Fan Coding for 9RS08KA2

 

;*

Vincent Ko

 

;* Author:

 

;* Date:

Jan 2006

 

;*

 

RC input

;* PTA0/KBI0/ACMP+

;* PTA1/KBI1/ACMP-

Temp sensor input

;* PTA2/KBI2/TCLK/RESETb/VPP

Hall input

;* PTA3/ACMPO/BKGD/MS

Buzzer

;* PTA4/KBI4

 

PWM+

;* PTA5/KBI5

 

PWM-

;*

 

 

;**************************************************************

;include derivative specific macros

XDEF Entry

include "MC9RS08KA2.inc"

;=========================================================================

;ICS Definition ;=========================================================================

ICS_DIV_1equ$00

ICS_DIV_2equ$40

ICS_DIV_4equ$80

ICS_DIV_8equ$c0

;=========================================================================

;MTIM Definition ;=========================================================================

MTIM_DIV_1 equ $00

MTIM_DIV_2 equ $01

MTIM_DIV_4 equ $02

MTIM_DIV_8 equ $03

MTIM_DIV_16 equ $04

MTIM_DIV_32 equ $05

MTIM_DIV_64 equ $06

MTIM_DIV_128

equ

$07

MTIM_DIV_256

equ

$08

MTIM_BUS_CLK equ

$00

MTIM_XCLK

equ

$10

 

 

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

 

 

Freescale Semiconductor

25

Image 25
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 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