wgyoume 发表于 2010-6-26 09:22:59

求助MSP430F449的串口收发程序

在这里求助MSP430F449的串口收发程序,还请各位兄弟帮帮忙。因为都很多天了,还没有弄出来。谢谢了

marklee 发表于 2010-8-24 13:16:25

回复【楼主位】wgyoume 上善若水
-----------------------------------------------------------------------

void inituart0(void)
{
UTCTL0 = SSEL1;                     // UCLK = SMCLK
UBR00 = 0x09;                         // 1MHz 115200
UBR10 = 0x00;                         // 1MHz 115200
UMCTL0 = 0x0A;                        // modulation
UCTL0 = CHAR;                         // 8-bit character *SWRST*
ME1 |= UTXE0 + URXE0;               // Enable USART0 TXD/RXD
IE1 |= UTXIE0;                        // Enable USART0 TX interrup               // Enable USART0 TX interrupt
P2SEL |= 0x30;                        // P2.4,5 = USART0 TXD/RXD
P2DIR |= 0x10;                        // P2.4 output direction
}

#pragma vector=UART0TX_VECTOR
__interrupt void usart0_tx(void)

{
TXBUF0=displaybuffer;
temptx=temptx+1;
if(temptx==4)
{
    temptx=0;
    flag=0;
      }
}

你用这个改改试试,以前调通的
页: [1]
查看完整版本: 求助MSP430F449的串口收发程序