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.

[参考译文] 为什么我无法将引脚设置为零

Guru**** 2482155 points
Other Parts Discussed in Thread: MSP430F2419

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1250143/why-i-cann-t-put-pin-to-zero

主题中讨论的其他器件:MSP430F2419

我正在使用 MSP430F2419

int main (空)
{
  WDTCTL = WDTPW + WDTHOLD;//停止看门狗计时器

  while (1)
 {
    P1OUT &=~0x02;
  }

为什么我不能将 p1.1置为零?

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

    您好!

    您需要首先将 GPIO 引脚设置为输出。  默认情况下、下电上电后所有 GPIO 引脚均为输入。

    在您停止看门狗之后、请使用以下命令:

    P1DIR |= 0x02;

    BTW、您也可以使用此命令来执行相同操作:

    P1DIR |= BIT1;