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.

关于28335重复中断的问题

335中断中有如下描述

If interrupts are enabled, but the interrupt flag is already set, then the counter will hold its output high
until the ENTFLG[INT] flag is cleared. This allows for one interrupt to be pending while one is serviced.

就是一个中断进来,又有一个中断的话会被hold住,等待执行结束后再次执行,如果我想配置为中断执行时直接丢弃新的中断,该如何配置。

目前的应用是PWM有外部同步信号输入,中断还是用0和周期中断,中断执行时可能有同步信号输入再次产生中断,目前是想把同步信号的中断丢弃掉,如何配置寄存器

  • 也就是你在进入中断后不再让别的中断打扰

    最简单的办法是在中断函数中关闭其他中断

    执行结束时再次打开

  • mangui zhang 说:

    也就是你在进入中断后不再让别的中断打扰

    最简单的办法是在中断函数中关闭其他中断

    执行结束时再次打开

    你这个方法在中断退出后“执行结束后再次执行

    建议这么做,执行中断的时候,将全局中断禁止,在中断ISR退出之前将相应的中断标志位清空一下,新的被pending的中断就不会响应了。

  •  我这样试过 在刚开始diable中断,然后中断结束处清除标志位并且重新使能中断,还是无法避免再次进入中断。

    在335PWM中断处  有如下描述:

    When ETPS[INTCNT] = ETPS[INTPRD] the counter stops
    counting and its output is set. The counter is only cleared when an interrupt is sent to the PIE.  

    Writing to the INTPRD bits will automatically clear the counter INTCNT = 0 and the counter output will be
    reset (so no interrupts are generated)

    我这样操作同样也是无法清除第二次中断