请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
部件号:MSP430F1611 我是 CCS 的新用户,我尝试使用 TI 编译器 v21.6.0.LTS 将 IAR 汇编项目转换为 CCS。 但 A 不知道如何声明变量等...就像在下面的代码中看到的那样。有人可以帮助我吗?
;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430.h" ; Include device header file
;-------------------------------------------------------------------------------
.def RESET ; Export program entry-point to
; make it known to linker.
.def PosicLlavesNueva 1 ;// 0: Modelo viejo , 1: Modelo Nuevo
;#define EnableCalibracion 0 ;// Modo Calibracion ( Solo Medicion )
.def EnableWachDogInt 0 ;//
;-------------------------------------------------------------------------------
.text ; Assemble into program memory.
.retain ; Override ELF conditional linking
; and retain current section.
.retainrefs ; And retain any sections that have
; references to current section.
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
;//mudança da constante de comparação do long de 1.05 para 1.17 (linha 3334)
;#define EnableLongTime 1 // Segun Modelo de llave
;#define EnableShortTime 1 //
;#define EnableGFault 0 //
Nmax_Vars_ModbusRTU .set 16
;#define Nmax_Vars_ModbusRTU 16
#define FAST_CRC 1
LimiteINF DEFINE 0
LimiteSUP DEFINE 2
.include "msp430x14x.h" // definicion de I/O del integrado
Fac_Cresta DEFINE 1414 ; Fator de Cresta en * 1000 ( entre 1 y 2 )
Vmax DEFINE 4092 ; Maximo Valor del conversor por comodidad de calculo
RmsMaximo DEFINE (Vmax)*1000/Fac_Cresta; Valor RMS Maximo dado un factor de Cresta
INominal DEFINE (RmsMaximo)/10 ; Valor de IN teorico
EntSincro DEFINE P1IN ; PORT1
IFGSincro DEFINE P1IFG
SincroR DEFINE 0001h ; PORT 1.0
SincroS DEFINE 0002h ; PORT 1.1
SincroT DEFINE 0004h ; PORT 1.2
SignoR DEFINE 0001h
SignoS DEFINE 0002h
SignoT DEFINE 0004h
SignoN DEFINE 0008h
Instant DEFINE 0010h ; PORT 1.4
EntInstat DEFINE P1IN
IFGinstat DEFINE P1IFG
WdgEXT DEFINE 0040h ; PORT 1.6
SalWdgEXT DEFINE P1OUT
Disparo DEFINE 0008h ; PORT 3.3
SalDisparo DEFINE P3OUT
LedLT DEFINE BIT7 ; Ä¿
LedST DEFINE BIT6 ; ³
LedFT DEFINE BIT4 ; ÃÄ Leds Indicacion de corte
LedINST DEFINE BIT5 ; ³
LedsCorte DEFINE P4OUT ; ÄÙ
Led70 DEFINE BIT2 ; Ä¿
LedSobreCarga DEFINE P3OUT ; ÄÁÄ Led Sobrecarga
BaseTiempoFija EQU 00d ; 1: Mide con base de tiempo fija
; 0: Mide con base de tiempo fija t< 1 Seg
; t > 2 Seg Se adaptara en frecuencia
Muestras50Hz EQU 64d ; Cantidad de muestras a 50Hz
; 64: ( 45Hz: 72 65Hz: 48 )
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
;º Constantes en Rom º
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ORG 0A000h
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Parametros de calibracion Default ³ Impreso Llave3
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
;Diodo Temp Amb:
;
; *
; T= [ Vd(T) - Vd(0) ] / TCd , TCd = 3.55mV / §C +- 3% (3.44 - 3.65 )
; , Vd(0)= 986mV +- 5% ( 937 - 1035 )
; *
; Tsamp[Min] = 30uS
TCdx1000 DEFINE 4095*355/250 ;[5.8149] (5.63 - 5.98)
Vd0 DEFINE 4095*951/2500 ;[1615] (1535 - 1695)
KeySegmentoA DEFINE 0AA5h