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.

MSP430G2553的串口调试问题

Other Parts Discussed in Thread: MSP430G2553

#include  "msp430g2553.h"

void main(void)

{

WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

P1DIR = 0xFF;                             // All P1.x outputs

P1OUT = 0;                                // All P1.x reset

P2DIR = 0xFF;                             // All P2.x outputs

P2OUT = 0;                                // All P2.x reset

P1SEL = BIT1 + BIT2 ;                     // P1.1 = RXD, P1.2=TXD

P1SEL2= BIT1 + BIT2 ;                     // P1.1 = RXD, P1.2=TXD

P3DIR = 0xFF;                             // All P3.x outputs

P3OUT = 0;                                // All P3.x reset  

UCA0CTL1 |= UCSSEL_1;                     // CLK = ACLK

UCA0BR0 = 0x03;                           // 32kHz/9600 = 3.41

UCA0BR1 = 0x00;                           //

UCA0MCTL = UCBRS1 + UCBRS0;               // Modulation UCBRSx = 3

UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**

IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt

__bis_SR_register(GIE);                   // Enter LPM3, interrupts enabled

}

// Echo back RXed character, confirm TX buffer is ready first

#pragma vector=USCIAB0RX_VECTOR

__interrupt void USCI0RX_ISR(void)

{

while (!(IFG2&UCA0TXIFG));                 // USCI_A0 TX buffer ready?

UCA0TXBUF = UCA0RXBUF;                     // TX -> RXed character

}

串口接收中断进不去,串口调试助手看不到数据

谢谢您的回答.

我现在能够正常操作了,但是我用外部接PL2303电平转换的串口调试操作的,能够发送数据进入中断,但是用LanuchPad的电源线自带的虚拟串口却不能用,能解释下吗?谢谢

另外,我在写硬件SPI的时候感觉有很多问题,您能够发个硬件SPI的例程给我看看吗?谢谢啦