莫名其妙啊!URXIE0不能置位!

2019-03-24 15:44发布

程序这样写的,感觉没什么问题,但是调试的时候就是发现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   } 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
15条回答
零晨
2019-03-26 14:05
原来如此,困扰了我两天了,感谢版主啊!

一周热门 更多>

相关问题

    相关文章