程序这样写的,感觉没什么问题,但是调试的时候就是发现URXIE0不能置位为1! 好奇怪,请教高手,这是为什麽!(IE1 |= URXIE0;指令错了么?) void Init_Sys(void) { unsigned int i=0; //To control the loop for clearing RAM unsigned int *ptr=(unsigned int *)(0x0200); //define a pointer for clearing RAM WDTCTL = WDTPW + WDTHOLD; //close the watch dog timer BCSCTL1 = 0x00; IFG1 &=~ OFIFG; //clear the flag of Oscillator Fault while((OFIFG&IFG1)) //Wait for OFIFG = 0 IFG1 &=~ OFIFG;; BCSCTL2 = SELM1 + SELS + 6; P1DIR |= 0Xff; //Set up port P1 -> Output P1OUT &=~ 0xff; //Set up P1 output -> low for(i;i<512;i++) //Clear the RAM (0200H ~ 05FFH) { *ptr=0x0000; ptr++; } TACTL = TASSEL_2 + ID_3; //Set up Timer_A CCR0 = 0xffff; UCTL0 |= CHAR; //Set up the width of signal is 8 bits UTCTL0 |= SSEL1 + SSEL0; //Set up SMCLK UBR00 = 0X60; //Set up Baud rate 0 UBR10 = 0X00; UMCTL0 = 0X00; ME1 |= UTXE0 + URXE0; //UART receive and transmit enable IE1 |= URXIE0; //UART receive-interrupt enable ---? P3SEL |= 0x30; //Select P3.4 & P3.5 to UART mode }
|