关于ARM M3 UART的问题



我用TI的ARM 开发板 LM3S9B96开发板调试UART 的时候出现一个我问题:

    问题如下,我用电脑向ARM 发送数据的时候,我调试的时候每执行一条语句,串口都会收到数据,一大串数据,我很奇怪,我看过电路图,USB 转JATG,没有问题。但是就是无法接收和发送。(没有影响到数据发送和接收)

   波特率数据格式 我都注意过,没有问题。(以前做单片机 我是没有问题的 能发能收)

程序如下:

#include "hw_ints.h"        // memmAP的上一级库

#include "hw_memmap.h"      //存储单元分配

#include "hw_types.h"       // driverlib上一级库

#include "gpio.h"           //GPIO函数库

#include "sysctl.h"         //系统设置

#include "interrupt.h"

#include "driverlib/debug.h"

#include  "uart.h"

#include  "ctype.h"

#include  "string.h"

void clockInit(void);

unsigned long TheSysClock ;

void uartPuts(const char *s);

void main()

{

 char RXData;

 clockInit();

 //enable USART

 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

 SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

 //configure RX and TX

 GPIOPinConfigure(GPIO_PA0_U0RX);

 GPIOPinConfigure(GPIO_PA1_U0TX);

 // configured for use as a peripheral function (instead of GPIO).

 GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

 // Configure the UART for 115,200, 8-N-1 operation.

 // This function uses SysCtlClockGet() to get the system clock

 // frequency.  This could be also be a variable or hard coded value

 // instead of a function call.

 UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(),9600,

                       (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |

                        UART_CONFIG_PAR_NONE));

 UARTIntEnable(UART0_BASE,UART_INT_RX|UART_INT_RT);

 IntEnable(INT_UART0);

 IntMasterEnable();

 UARTEnable(UART0_BASE);

 uartPuts("hello, please input a string:\r\n");

 while(1)

 {

  RXData=UARTCharGet(UART0_BASE);

  UARTCharPut(UART0_BASE,RXData);

  if(RXData=='\r')

  {

    UARTCharPut(UART0_BASE,'\n');

  }

 }

}

void uartPuts(const char *s)

{

while( *s != '\0')

{

UARTCharPut(UART0_BASE,*(s++));

}

}

void clockInit(void)

{

    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |

                      SYSCTL_XTAL_16MHZ);                       //  分频结果为20MHz

   TheSysClock = SysCtlClockGet();                         //  获取当前的系统时钟频率

}