dashashi 发表于 2012-6-2 12:02:47

单片机不用的引脚应该怎么处理?

以前一直觉得不用就悬空就好了
昨天看了个视频,说如果不用的引脚设置为输入,然后又悬空可能产生很大的电流、把单片机搞坏什么的- -||
不知道大家都是怎么处理的?

pro2013 发表于 2012-6-2 12:09:30

设置为输出

dashashi 发表于 2012-6-2 12:20:48

电路上需要做什么处理吗?

orson 发表于 2012-6-2 12:25:52

设置为输入,用电阻连接到地上!这个要看各个单片机的具体设计的!看看他的使用手册,有说明的!

wye11083 发表于 2012-6-2 12:31:59

单片机没用到的都可以不管它,没事的。

qwerttt 发表于 2012-6-2 19:07:54

手册有,置成输出高
尤其是低功耗产品,我这里低功耗仪表产品都是输出高

lcofjp 发表于 2012-6-2 19:25:29

论坛有类似的讨论,并且回答都差不多。
不知道各位有没有用过430?可能大家也都是根据自己的经验来回答楼主,但可能不是用在430上,就把楼主误导了。
————————————————————————————————————
貌似记得某文档上写着,对于没有使用的引脚,应设置为输出,高低皆可。

dashashi 发表于 2012-6-2 20:36:18

主要是看了个视频把我看怕了- -||

skynet 发表于 2012-6-2 20:40:31

不同MCU,根本不同,有些还是完全相反的设置

dashashi 发表于 2012-6-2 20:43:08

嗯- -还是仔细看看手册比较好

skynet 发表于 2012-6-3 10:40:56

430系列,官方权威说法
在用户指南 Digital I/O -> Ditital I/O operarion -> configuring unused port pins 这里

charley 发表于 2012-6-8 00:53:32

同意6楼,430系列,我一直都是设置为输出高。当时测试过,输出低的时候,功耗和输出高的时候,略微有些差别,要大一点点(用万用表测的,也可能测的不准哈,呵呵)。

86hupeng 发表于 2012-6-8 08:08:04

输出输入有区别的,输出可以是高阻态,所以输出可能更省一点点电

chengwanshan 发表于 2012-6-12 15:29:40

// P2.2 - P2.6 is unused
P2OUT &= ~(BIT2 + BIT3 + BIT4 + BIT5 + BIT6);   
P2DIR &= ~(BIT2 + BIT3 + BIT4 + BIT5 + BIT6);
P2REN |= (BIT2 + BIT3 + BIT4 + BIT5 + BIT6);
官方是这么处理的,供参考

tns9728 发表于 2012-6-13 23:27:50

MSP430 Family User's Guide提到:
10.2.8 Configuring Unused Port Pins
Unused I/O pins should be configured as I/O function, output direction, and left unconnected on the PC
board, to prevent a floating input and reduce power consumption. The value of the PxOUT bit is don't
care, because the pin is unconnected. Alternatively, the integrated pullup/pulldown resistor can be enabled
by setting the PxREN bit of the unused pin to prevent the floating input. See the SYS chapter for
termination of unused pins.

shaxjl1 发表于 2014-1-10 12:00:44

skynet 发表于 2012-6-3 10:40
430系列,官方权威说法
在用户指南 Digital I/O -> Ditital I/O operarion -> configuring unused port pins ...

非常感谢,有用~~
STM8 中的配置

Unused I/O pins
Unused I/O pins must not be left floating to avoid extra current consumption. They must be
put into one of the following configurations:
● connected to VDD or VSS by external pull-up or pull-down resistor and kept as input
floating (reset state),
● configured as input with internal pull-up/down resistor,
● configured as output push-pull low.
页: [1]
查看完整版本: 单片机不用的引脚应该怎么处理?