?? fc430_es417_cce.asm
字號:
;-------------------------------------------------------------------------------
; FC430 ES417 Demo - Digital Fan Control w/ Tachometer (TI CCE ASM version)
;
; Description: Drives cooling fan speed based on thermistor temperature
; Results: Displays tachometer and temperature on SoftBaugh SBLCDA4 LCD
; ACLK = UCLK0 = LFXT1 = 32.768 kHz
; MCLK = SMCLK = 32*ACLK = DCO = ~1.048576 MHz
; (external watch crystal is required on XIN XOUT for ACLK)
;
;
; MSP430F417
; ------------------------
; /|\ | XIN|--- |
; | | | 32kHz
; ----|RST XOUT|--- |
; | |
; LED <---|P1.0 P2.1/TA1.1|---> PWM
; | |
; Rsens --->|P1.4 P2.0|<--- TACH
; | |
; Rref --->|P1.5 |
; | |
; Cm --->|P1.6/CA0 |
; | |
; | |
; | P2.2 -- P4.4, P5.1 |
; ------------------------
; | | | | | | | | | | | |
; v v v v v v v v v v v v
; ------------------------
; | SBLCDA4 LCD DISPLAY |
; ------------------------
;
;
; Randy Wu
; Texas Instruments Inc.
; November 2005
; Built with TI CCE PRO Version: 1.00
;
; THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR
; REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,
; INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
; FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR
; COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE.
; TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET
; POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY
; INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR
; YOUR USE OF THE PROGRAM.
;
; IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
; CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY
; THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED
; OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT
; OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM.
; EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF
; REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS
; OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF
; USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S
; AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF
; YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS
; (U.S.$500).
;
; Unless otherwise stated, the Program written and copyrighted
; by Texas Instruments is distributed as "freeware". You may,
; only under TI's copyright in the Program, use and modify the
; Program without any charge or restriction. You may
; distribute to third parties, provided that you transfer a
; copy of this license to the third party and the third party
; agrees to these terms by its first use of the Program. You
; must reproduce the copyright notice and any other legend of
; ownership on each copy or partial copy, of the Program.
;
; You acknowledge and agree that the Program contains
; copyrighted material, trade secrets and other TI proprietary
; information and is protected by copyright laws,
; international copyright treaties, and trade secret laws, as
; well as other intellectual property laws. To protect TI's
; rights in the Program, you agree not to decompile, reverse
; engineer, disassemble or otherwise translate any object code
; versions of the Program to a human-readable form. You agree
; that in no event will you alter, remove or destroy any
; copyright notice included in the Program. TI reserves all
; rights not specifically granted under this license. Except
; as specifically provided herein, nothing in this agreement
; shall be construed as conferring by implication, estoppel,
; or otherwise, upon you, any license or other right under any
; TI patents, copyrights or trade secrets.
;
; You may not use the Program in non-TI devices.
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430x417.h"
;********************************** CONSTANTS **********************************
; Port1 Pin Configuration
ACTIVITY .equ BIT0 ; System activity LED
THERM .equ BIT4 ; Thermistor used for temp. sensor
REF .equ BIT5 ; Charges reference cap 4 SlopeA/D
CAIN .equ BIT6 ; CA0 input on P1.6
; Port2 Pin Configuration
TACH .equ BIT0 ; Frequency Generator signal of fan
PWM .equ BIT1 ; PWM signal to vary fan duty cycles
; System variables
PERIOD050USEC .equ 52 ; assuming ~1.048576 MHz DCO clock
DUTYCYCLE_030 .equ 15 ; duty cycle = 30%
DUTYCYCLE_045 .equ 23 ; duty cycle = 45%
DUTYCYCLE_060 .equ 31 ; duty cycle = 60%
DUTYCYCLE_080 .equ 41 ; duty cycle = 80%
DUTYCYCLE_100 .equ (PERIOD050USEC-1) ; duty cycle = 100%
PERIOD5MSEC .equ 5243 ; 5 msec worth of SMCLK = DCO tics
PULSESPERREV .equ 2 ; # of FG pulses per 1 rev. of fan
TEMP_CALFACTOR .equ 10 ; temp. sensor calibration factor
FANSLEVEL0 .equ 0 ; System level 0 (minimum cooling)
FANSLEVEL1 .equ 1 ; System level 1
FANSLEVEL2 .equ 2 ; System level 2
FANSLEVEL3 .equ 3 ; System level 3
FANSLEVEL4 .equ 4 ; System level 4
FANSLEVEL5 .equ 5 ; System level 5 (maximum cooling)
DEGFWIDTH .equ 7 ; # of degrees F per level change
PWM_L0 .equ -50 ; 0th temp boundary (deg F)
PWM_L1toL2 .equ 70 ; 1st temp boundary (deg F)
PWM_L2toL3 .equ (PWM_L1toL2+DEGFWIDTH) ; 2nd temp boundary (deg F)
PWM_L3toL4 .equ (PWM_L2toL3+DEGFWIDTH) ; 3rd temp boundary (deg F)
PWM_L4toL5 .equ (PWM_L3toL4+DEGFWIDTH) ; 4th temp boundary (deg F)
PWM_L5 .equ (PWM_L3toL4+DEGFWIDTH) ; 5th temp boundary (deg F)
;********************** CONSTANT DATA: LCD SEGMENT TABLE ***********************
; ES417-to-SBLCDA4: LCD segment memory map
; LCDM1: 1F 1G 1E DP1 1A 1B 1C 1D
; LCDM2: 2F 2G 2E DP2 2A 2B 2C 2D
; LCDM3: 3F 3G 3E COL3 3A 3B 3C 3D
; LCDM4: 4F 4G 4E DP4 4A 4B 4C 4D
; LCDM5: 5F 5G 5E COL5 5A 5B 5C 5D
; LCDM6: 6F 6G 6E DP6 6A 6B 6C 6D
; LCDM7: 7F 7G 7E DP7 7A 7B 7C 7D
; LCDM8: F1 F2 F3 F4 F5 PR P4 P3
; LCDM9: AU AR AD AL PL P0 P1 P2
; LCDM10: BT B1 B0 BB ANT A2 A1 A0
; LCDM11: DOLL ERR MINUS MEM ENV TX RX 8BC
h .equ 0x80
e .equ 0x40 ; AAAA
g .equ 0x20 ; F B
f .equ 0x10 ; F B
d .equ 0x08 ; GGGG
c .equ 0x04 ; E C
b .equ 0x02 ; E C
a .equ 0x01 ; DDDD
;************************ CONSTANT DATA: LOOK UP TABLES ************************
;-------------------------------------------------------------------------------
; Initialized Constant Values
.sect ".const"
.align 2
;-------------------------------------------------------------------------------
LCD_Table:
.field a+b+c+d+e+f,8 ; Displays "0"
.field b+c,8 ; Displays "1"
.field a+b+d+e+g,8 ; Displays "2"
.field a+b+c+d+g,8 ; Displays "3"
.field b+c+f+g,8 ; Displays "4"
.field a+c+d+f+g,8 ; Displays "5"
.field a+c+d+e+f+g,8 ; Displays "6"
.field a+b+c,8 ; Displays "7"
.field a+b+c+d+e+f+g,8 ; Displays "8"
.field a+b+c+d+f+g,8 ; Displays "9"
.field a+b+c+e+f+g,8 ; Displays "A"
.field 0,8 ; Displays <Blank>
.field a+d+e+f,8 ; Displays "C"
.field a+b+f+g,8 ; Displays "degrees" o
.field a+d+e+f+g,8 ; Displays "E"
.field a+e+f+g,8 ; Displays "F"
.field h,8 ; Displays ":" or "."
.field g,8 ; Displays "-"
.field f+g+e+d,8 ; Displays "t"
;-------------------------------------------------------------------------------
; Resistance table, K ohms from 99 down to 32 degrees F.
; NOTE: Values must be calculated based on a specific type of thermistor
;-------------------------------------------------------------------------------
RES_TAB .field 1900,16 ; 99 F
.field 1900,16
.field 2000,16
.field 2100,16
.field 2200,16 ; 95 F
.field 2200,16
.field 2300,16
.field 2400,16
.field 2500,16
.field 2600,16 ; 90 F
.field 2700,16
.field 2800,16
.field 2900,16
.field 3000,16
.field 3100,16 ; 85 F
.field 3200,16
.field 3300,16
.field 3500,16
.field 3600,16
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -