2651 views|0 replies

1662

Posts

0

Resources
The OP
 

How to generate a .txt file on CCS and burn it to MSP430 [Copy link]

This post was last edited by Hot Ximixiu on 2020-9-12 19:53

Since the CCS platform program will directly generate a .out file for emulator program download after compilation, and when developing the MSP430 microcontroller, BSL download may be required, then it is necessary to generate a .txt file for BSL program burning.

This video briefly describes how to edit the MCU program on CCS to generate a .txt file and use BSL to burn the program into the MCU. (The version I used is CCS8.1.0)

1. Create the project file correctly on CCS.

Create a new project: File->New->CCS Project

2. Write the program in the main.c file and save it.

 1 #include <msp430f169.h>
 2 /*
 3  * 软件延时
 4  */
 5 #define CPU_F1 ((double)1000000)
 6 #define delay_us1M(x) __delay_cycles((long)(CPU_F1*(double)x/1000000.0))
 7 #define delay_ms1M(x) __delay_cycles((long)(CPU_F1*(double)x/1000.0))
 8 
 9 /**
10  * main.c
11  */
12 int main(void)
13 {
14     unsigned char j,k;
15     WDTCTL = WDTPW + WDTHOLD;//关看门狗
16     P6DIR = 0xff;//设置P4端口为输出端口
17     while(1)
18     {
19         k = 1;
20         for(j=0;j<8;j++)//循环8次,即D1~D8轮流点亮
21         {
22             P6OUT = ~k;//反相输出,低电平点亮LED
23             delay_ms1M(300);//延时
24             k=k<<1;//左移一位
25         }
26     }
27 
28 }

3 Compile program: Project-Build All

4. Configure CCS to generate a .hex executable file (the .hex file is burned into the chip when simulating with Protues)

Project->Properties->MSP430 Hex Utility

Check Enable MSP430 Hex Utility and then select Output Format Options. In the Output format column, select Output TI-TXT hex format (--ti_txt)

7. Compile the program again and a .txt file will be generated

result:

**** Build of configuration Debug for project LCD ****

"D:\\TI\\ccsv8\\utils\\bin\\gmake" -k -j 4 all -O

gmake[1]: 'LCD.out' is up to date.
Building files: "LCD.out"
Invoking: MSP430 Hex Utility
"D:/TI/ccsv8/tools/compiler/ti-cgt-msp430_18.1.2.LTS/bin/hex430" --memwidth=8 --romwidth=8 -o "LCD.hex" "LCD .out"
Translating to Extended Tektronix format...
"LCD.out" .text ==> .text
"LCD.out" DACDMA ==> DACDMA
"LCD.out" PORT2 ==> PORT2
"LCD.out" USART1TX = => USART1TX
"LCD.out" USART1RX ==> USART1RX
"LCD.out" PORT1 ==> PORT1
"LCD.out" TIMERA1 ==> TIMERA1
"LCD.out" TIMERA0 ==> TIMERA0
"LCD.out" ADC12 ==> ADC12
"LCD.out" USART0TX ==> USART0TX
"LCD.out" USART0RX ==> USART0RX
"LCD.out" WDT ==> WDT
"LCD.out" COMPARATORA ==> COMPARATORA
"LCD.out" TIMERB1 ==> TIMERB1
"LCD.out" TIMERB0 ==> TIMERB0
"LCD.out" NMI ==> NMI
"LCD.out" .reset ==> .reset
Finished building: "LCD.out"

"D:/TI/ccsv8/tools/compiler/ti-cgt-msp430_18.1.2.LTS/bin/hex430" --ti_txt "LCD.out" -o "LCD.txt " -order MS -romwidth 16
Translating to TI-TXT format...
"LCD.out" .text ==> .text
"LCD.out" DACDMA ==> DACDMA
"LCD.out" PORT2 ==> PORT2
"LCD.out" USART1TX ==> USART1TX
"LCD.out" USART1RX ==> USART1RX
"LCD.out" PORT1 == > PORT1
"LCD.out" TIMERA1 ==> TIMERA1
"LCD.out" TIMERA0 ==> TIMERA0
"LCD.out" ADC12 ==> ADC12
"LCD.out" USART0TX ==> USART0TX
"LCD.out" USART0RX == > USART0RX
"LCD.out" WDT ==> WDT
"LCD.out" COMPARATORA ==> COMPARATORA
"LCD.out" TIMERB1 ==> TIMERB1
"LCD.out" TIMERB0 ==> TIMERB0
"LCD.out" NMI == > NMI
"LCD.out" .reset ==> .reset

**** Build Finished ****

8. We use BSL430 to burn the program, that is, to transfer the .txt file we get to the chip to control the CPU work

SF_BSL430 software download link: https://pan.baidu.com/s/1tumqUGFZhx_83ynXRS3Ugw

After downloading, we run the application as an administrator.

(1) Select the serial port number (you need to install the USB to serial port driver CH340 or CH341 link: https://pan.baidu.com/s/1DvtcWuatTF9EtwSaBLhbog)

Enter the computer management system - device manager - port to find the serial port number (the development board must be connected and powered on)

(2) Load the burning file.

Go to the project folder -Debug folder and find the .txt file

(3) Execute (if the burning may fail, please power off the development board and then power it on again to try burning again)

result:

This post is from Microcontroller MCU
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list