能够正确接收,但是发送错误。用示波器观察P1.2管脚,一直为低电平。不知何故?初始化程序如下:
//uart初始化
UCA0CTL0=0X00; //LSB first
UCA0CTL1=UCSSEL1;//SMCLK(1MHz)
UCA0BR0=26; //1000000/38400=26
UCA0BR1=0;
UCA0MCTL=0x00;
IE2=UCA0RXIE; //RXD interrupt enable
UCA0CTL0 &= ~UCSWRST; // Initialize USART state machine |