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.

MSP430G2553 IO端口中断和PxSEL的问题



DataSheet上是这么说的:

NOTE: P1 and P2 Interrupts Are Disabled When PxSEL = 1
When any P1SELx or P2SELx bit is set, the corresponding pin's interrupt function is
disabled. Therefore, signals on these pins will not generate P1 or P2 interrupts, regardless of
the state of the corresponding P1IE or P2IE bit.

是P1或P2任意管脚的PxSELx=1都会导致P1和P2所有的外部中断都被禁用么还是说只有对应管脚的,例如

P1SEL=BIT1那么P1.0的外部中断还能用么

另外IO端口的外部中断对触发信号的跳变时间有要求么,比如设置为下降沿触发,如果输入信号由高电平变为低电平的速度很慢会触发外部中断么

我现在外部中断有点奇怪,P1.0设置为下降沿触发,P1.1、P1.2、P1.4设置为SPI,触发信号来自另一个芯片,测量其电平确实是由高变为低了,但是没有触发外部中断,但是我将IO管脚短接一下VCC就进入中断了(被拉高然后恢复为低)。

  • tong,

      按照datasheet上的解释,应该是当相应的P1SEl或P2SEl的某个管脚设置成1,即使用管脚的第二功能是,该GPIO的外部中断功能就会被禁止。

    这个可以理解,因为此时该管脚已经不工作在GPIO功能下了。

    你在设置了P1.0为外部中断,其他几个管脚设置为SPI是不会影响他的中断响应的。不能响应应该还是你的输入信号的原因。

    谢谢