This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430F1611:将组装中的 IAR 项目转换为 CCS

Guru**** 2390755 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1073562/msp430f1611-convert-a-iar-project-in-assembly-to-ccs

部件号: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

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好,Julio,

    从 MSP430汇编器/链接器指南开始。  

    https://www.ti.com/lit/ug/slau131r/slau131r.pdf

    您也可以搜索互联网。  有很多“如何”视频和书面示例

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,丹尼斯,

    非常感谢! 你真的帮了我很多,但只是保留一些东西来导入项目。

    如何将#define 替换为 CCS