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.

CC2530 USART1通信出现乱码

Other Parts Discussed in Thread: CC2530

调试CC2530 USART1 P0.4和P0.5分别作TX和RX,我写了一段测试程序,在PC机利用串口调试助手与其通信,可串口调试助手总是接受到乱码,

附程序中部分USART1的设置:

void InitUART(void)
{
PERCFG &= ~0x02; //位置 1 P0 口
P0SEL = 0x3C; 
P1SEL &= ~0xF0;
P2DIR &= 0x7F;
P2DIR = 0x40; //P0 优先作为 UART1
U1CSR |= 0x80; //设置为 UART 方式
U1GCR |= 11;
U1BAUD |= 216; //波特率设为 115200

UTX1IF = 0; //UART1 TX 中断标志初始置位 0
}

void UartSend_String(char *Data,int len)
{
int j;
for(j=0;j<len;j++)
{
U1DBUF = *Data++;
while(UTX1IF == 0);
UTX1IF = 0;
}
}

void main(void)
{
CLKCONCMD &= ~0x40; 
while(CLKCONSTA & 0x40); 
CLKCONCMD &= ~0x47;

InitUART();

strcpy(Txdata,"HELLO WEBEE "); //将发送内容 copy 到 Txdata;
while(1)
{
UartSend_String(Txdata,sizeof("HELLO WEBEE ")); //串口发送数据
Delay_ms(500); //延时
}
}

求助,请帮帮我