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.

[参考译文] MSP430FR5962:清除 GPIO 中断问题

Guru**** 2439710 points


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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/977202/msp430fr5962-clear-gpio-interrupt-problem

器件型号:MSP430FR5962

你好,Forum

清除 GPIO 中断时出现问题。 我已启用 PORT3引脚3中断。

P3DIR &=~(BIT3);
P3OUT |= BIT3;
P3REN = BIT3;//为中断输入选择上拉模式*/
P3IES = BIT3;//高/低边沿*/
P3IFG = 0U;/*清除所有 P3中断标志? *
P3IE = BIT3;/*中断被启用*/

当我启用中断和全局中断时、会立即进入中断矢量。 这是可以的、当在中将边沿检测设置为下降边沿时、会正确发生。 (即使引脚为高电平)。

现在、我在中断中做的第一件事是清除所有挂起的中断(P3IFG = 0)。

我本以为这会清除 P3IFG、其值为0x08 (正如我所期望的、由于进入中断)。

但 P3IFG 未被清除、之后仍然为0x08。 即使我通过调试器清除寄存器(向寄存器写入0)、位3也不会清除。 我尝试读取 P3IV、但这不会改变它。  

我是否需要了解其他详细信息? 引脚应该是稳定的、因为我在这个引脚上只有一个外部上拉电阻器。

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

    你(们)好。

    按照手动12.3.1 (复位后的配置)、我似乎需要在禁用锁定后启用中断。