工具/软件:Code Composer Studio
如上图所示。 小数点有时会被一个奇怪的字符取代。 是否有人知道导致此行为的原因以及如何解决此问题?
此致、
Erik
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.
工具/软件:Code Composer Studio
如上图所示。 小数点有时会被一个奇怪的字符取代。 是否有人知道导致此行为的原因以及如何解决此问题?
此致、
Erik
使用逻辑分析仪、我注意到问题出在传输侧。 我已向代码添加数组(Teststring)、该数组遵循小数点应位于的索引处的数据值。 我注意到、值在'while (UCA0STATW&UCBUSY)之后发生变化;//等待数据已发送'行。
void UART_Send (char Data[]) { Teststring[0]= Data[1]; while (Data[u]!='\0')//'\0'(空)字符表示数据结束 { if (u = 0) Teststring[1]=数据[1]; if (u = 1) Teststring[5]=数据[u]; UCA0TXBUF =数据[u]; if (u = 0) Teststring[2]=数据[1]; IF (数据[1]!= 0x2E && u = 1) __no_operation(); while (UCA0STATW&UCBUSY);//等待数据已发送 if (u = 0) Teststring[3]=数据[1]; U++; if (u = 1) Teststring[4]=数据[1]; } UCA0TXBUF =';'; while (UCA0STATW&UCBUSY);//等待数据已发送 UCA0TXBUF = 0x20;//空间(SP) U = 0; }