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.

[参考译文] TM4C1294NCPDT:GPIOPinWrite PM1&PM2未工作。

Guru**** 2603715 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1422763/tm4c1294ncpdt-gpiopinwrite-pm1-pm2-not-working

器件型号:TM4C1294NCPDT

工具与软件:

您好!

我正在尝试 在端口 M 引脚1和2上使用 GPIOPinWrite 功能、输出 没有变为1。

ROM_GPIOPinTypeGPIOOutput (GPIO_PORTM_BASE、GPIO_PIN_0);

ROM_GPIOPinTypeGPIOOutput (GPIO_PORTM_BASE、GPIO_PIN_1);

ROM_GPIOPinTypeGPIOOutput (GPIO_PORTM_BASE、GPIO_PIN_2);

然后在另一个函数中:

GPIOPinWrite (GPIO_PORTM_BASE、GPIO_PIN_1、1);  //无法正常工作

GPIOPinWrite (GPIO_PORTM_BASE、 GPIO_PIN_0、1);  //有效

GPIOPinWrite (GPIO_PORTM_BASE、 GPIO_PIN_2、1);  //无法正常工作

我看不出有什么原因。  

非常感谢您的帮助!

Tzipi

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [报价 userid="543483" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1422763/tm4c1294ncpdt-gpiopinwrite-pm1-pm2-not-working "]

    然后在另一个函数中:

    GPIOPinWrite (GPIO_PORTM_BASE、GPIO_PIN_1、1);  //无法正常工作

    GPIOPinWrite (GPIO_PORTM_BASE、 GPIO_PIN_0、1);  //有效

    GPIOPinWrite (GPIO_PORTM_BASE、 GPIO_PIN_2、1);  //无法正常工作

    [报价]

    您的代码不正确。 如果您想将 PM1设置为高电平、则需要进行如下写入。 GPIO_PIN_0是端口的第一个位、而 GPIO_PIN_1是端口的第二个位、同样 GPIO_PIN_2也位于端口的第三个位。 它是一个位包值。  

    GPIOPinWrite (GPIO_PORTM_BASE、GPIO_PIN_1、GPIO_PIN_1);   

    GPIOPinWrite (GPIO_PORTM_BASE、 GPIO_PIN_0、GPIO_PIN_0);   

    GPIOPinWrite (GPIO_PORTM_BASE、 GPIO_PIN_2、GPIO_PIN_2);   

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

    谢谢查尔斯!  

    这解决了我的问题

    另一个问题:如果我想把 PM1设置为低电平、如何操作?

    操作

    GPIOPinWrite (GPIO_PORTM_BASE、GPIO_PIN_1、0);   

    谢谢!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [报价 userid="543483" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1422763/tm4c1294ncpdt-gpiopinwrite-pm1-pm2-not-working/5471669 #5471669"]

    另一个问题:如果我想把 PM1设置为低电平、如何操作?

    操作

    GPIOPinWrite (GPIO_PORTM_BASE、GPIO_PIN_1、0);   

    [报价]

    正确。