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.

[参考译文] CCS/MSP430F5529:使用 UART 和 PuTTY

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/952385/ccs-msp430f5529-using-uart-and-putty

器件型号:MSP430F5529

工具/软件:Code Composer Studio

我在这里尝试输出一些代码、并从 PuTTY 终端获取输入。  我在设备管理器中验证了 COM 端口并确认了速度、但终端窗口中没有显示任何内容。  我在这里错过了我的错误。  可以在这里获得一些帮助吗?

//说明:在 PuTTY //
端口中设置以下参数: COM4
//波特率:115200
//数据位:8//
奇偶校验: 无
//停止位:1
//流控制:无

#include 
#include 
#include 
#include 
#include 

//输出和输入
字符的值 firstquestion[28]="请输入用户名:";
const char username[9]="用户名";
char usernameinput[9];
secondchar question[21]="输入密码:";
const char password[9]="密码";
char passwordinput[9];secondchar cy=34"int/

用户密码不正确!"intcr!"char password="、"counter"counter"counter"!"int"counter"counter"42"int"int"ch"!"int/密码不正确!"intcy"counter"!"chr!"int





//新行和回车
符 void newline (void)
{
while (!(UCA0IFG&UCTXIFG));//等待字符
UCA0TXBUF='\n'; //将字符设置为新行
while (!(UCA0IFG&UCTXIFG));//等待字符
UCA0TXBUF='\r\n'; //set character to carriage return
}
//提示用户名
void userdata (void)
{
对于(i=0;i "enter="" key"="" will="" break="" from="" receiving="" break;="" transmit="" buffer="" equal="" receive="" echo="" print="" what="" types="" usernameinput[i]="UCA0RXBUF;" uca0rxbuf="0;" clears="" adds="" null="" end="" array="" void="" passdata(void)="" i'*'="" bonus="" passwordinput[i]="UCA0RXBUF;" correct(void)="" i

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

    您是否正在使用 Launchpad? 如果是、它将 UCA1、而不是 UCA0用于通过 USB 的反向通道。 [参考 LP UG (SLAU533B)第2.2.6节]

    如果您不想更改代码、可以将 J1上的 P3.3/4引脚跳线连接到"桥接"接头上的 TXD/RXD 引脚(USB 侧)。