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.

cc430F5137死在while(UCB0CTL1 & UCTXSTT)

Other Parts Discussed in Thread: CC430F5137

cc430F5137烧录了cc430x513x_uscib0_i2c_04.c和cc430x513x_uscib0_i2c_05.c,运行后程序就死在了04.c的标红处

while (1)     {

                 while (UCB0CTL1 & UCTXSTP);             // Ensure stop condition got sent

         UCB0CTL1 |= UCTXSTT;                    // I2C start condition

         while(UCB0CTL1 & UCTXSTT);              // Start condition sent?

         UCB0CTL1 |= UCTXSTP;                    // I2C stop condition

                 __bis_SR_register(LPM0_bits + GIE);     // Enter LPM0, enable interrupts

         __no_operation();                       // For debugger

                     if (RXData != RXCompare)                // Trap CPU if wrong

         {

             P2OUT |= 0x60;                        // P2.6 = 1

         }

                 RXCompare++;                            // Increment correct RX value

     }