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.

[参考译文] CCS/MSP430FR5949:端口配置

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/846877/ccs-msp430fr5949-port-configuration

器件型号:MSP430FR5949

工具/软件:Code Composer Studio

 P2DIR = 0x00<<5;
 P2OUT = 0x00<<5;
 P2REN = 0x01<<5;
 while (P2IN &(0x01<5));

它不会使引脚保持高电平、直到 p2.5下拉、

P2SEL=0;

P2SEl2 = 0;

以上两条命令不起作用;显示编译时间错误。

我想使用上拉电阻器生成引脚2.5输入

谢谢

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

     P2SEL0=0x00<<5;
     P2SEL1=0x00<<5;
     P2DIR = 0x00<<5;
     //22OUT = 0x00<<5;
     P2REN = 0x01<<5;
     操作
     {
         C=(P2IN &(0x01<5));
     }
     while (c=1);

    我更改了代码、这里的 p2.5没有上拉? 请指导我。

    谢谢

    此致。

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

    您好!

    如果要将 pin2.5设置为使用上拉电阻器输入,只需要这些代码:

     

    P2DIR &=~BIT5;
    
    P2REN |= BIT5;
    
    P2OUT |= BIT5; 

    该芯片没有 P2SEL 寄存器、内部为 P2SEL0和 P2SEL1寄存器、更多详细信息、请参阅 FR5xx 的用户指南。

     

    此致

    Johnson