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.

关于MSP430程序问题

我学习到的 MSP430IO可以设成  输入和输出的,但是我想知道 一个IO口能不能既设成输出,又设成输入的程序啊。如果有 该怎么编程啊。。

  • 目前貌似430的IO不支持准双向模式,另外那种模式驱动能力都差的。所以你如果觉得不方便,有个方法,就是通过宏替换,把设置过程封装进去。

  • 您好,

    这个可以看下手册里PxDIR方向寄存器:

    12.2.3 Direction Registers (PxDIR)
    Each bit in each PxDIR register selects the direction of the corresponding I/O pin, regardless of the
    selected function for the pin. PxDIR bits for I/O pins that are selected for other functions must be set as
    required by the other function.
    • Bit = 0: Port pin is switched to input direction
    • Bit = 1: Port pin is switched to output direction

    没有其他的设置,http://www.ti.com.cn/cn/lit/ug/slau208p/slau208p.pdf