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.

[参考译文] MSP430F5172:如何输入I/O中断,然后立即将其关闭?

Guru**** 2587365 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/620533/msp430f5172-how-to-enter-i-o-interrupt-then-turn-off-it-immediately

部件号:MSP430F5172

尊敬的各位:

我要输入I/O中断,然后立即关闭中断,然后在执行某个函数后打开I/O中断。例如以下 代码:

#pragma vector=Port1_vector
__interrupt void Port_1 (void)
{//
关闭I/O中断
????

输入();

//打开I/O中断

????

如何实现问号功能??根据用户指南,我尝试了多种方法,但没有实现,我的理解可能是错误的。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你好,Jeff!

    您可以通过写入P1IE &=~0x01或任何要使用的PIN来禁用中断。 要启用它,您需要写入P1IE |= 0x01;确保通过写入P1IFG &=~0x01清除中断标志;但同时请记住,任何中断都不会中断您的中断;) 因此,只要清除ISR末尾的中断标志,就可以避免执行在执行功能期间生成的另一个中断(如果您有意这样做)。

    Dennis