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