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.

进不了IO中断

Other Parts Discussed in Thread: MSP430F2274

我用的是MSP430F2274,在程序初始化的时候配置了IO中断P1.0和P1.1,还有ADC10通道0-5,在单片机休眠的时候进不了IO中断,可是在休眠之前再次配置IO中断的话就可以进入IO中断,IO中断是配置上拉下降沿触发中断的,在单片机运行的时候仿真一切功能正常,就是在休眠的时候唤醒不Leeds

  • 你把如下的例程测试下

    void main(void) {

       WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer  

      P1IE |= 0x03;                             // P1.0 P1.1 interrupt enabled  

      P1IES |= 0x03;                            // P1.0,P1.1 Hi/lo edge  

       P1IFG &= ~0x03;                           // P1.0,P1.1 IFG cleared

      _BIS_SR(LPM4_bits + GIE);                 // Enter LPM4 w/interrupt }

    // Port 1 interrupt service routine

     #pragma vector=PORT1_VECTOR

    __interrupt void Port_1(void)

     {  

       P1IFG &= ~0x03;                           // P1.0,P1.1 IFG cleared

    }

  • 同意楼上的,先测试通了IO中断,再编写功能!

  • 测试了上面的IO中断功能都没有错,可以进入中断,我自己写的函数把IO中断初始化放在休眠之前也可以中断,就是放在程序最开始的地方不能进入中断

  • 测试了上面的IO中断功能都没有错,可以进入中断,我自己写的函数把IO中断初始化放在休眠之前也可以中断,就是放在程序最开始的地方不能进入中断

  • 建议使用带外部看门狗的复位芯片