|
大家给看下我这段串口定义的程序哪有错呀!!!
bis.b #030h,&P2SEL ; P2.4,5 = USART0 TXD/RXD
SetupUART0 bis.b #UTXE0+URXE0,&ME1 ; Ena××e USART0 TXD/RXD
bis.b #CHAR,&UCTL0 ; 8-bit characters
mov.b #SSEL1,&UTCTL0 ; UCLK = SMCLK
mov.b #06Dh,&UBR00 ; 1MHz 9600
mov.b #000h,&UBR10 ; 1MHz 9600
mov.b #003h,&UMCTL0 ; Modulation
bic.b #SWRST,&UCTL0 ; **Initialize USART state machine**
bis.b #URXIE0,&IE1 ; Ena××e USART0 RX interrupt
mov.b #01h,&TXBUF0 |
|