TI中文支持网
TI专业的中文技术问题搜集分享网站

CC2541 的IO 上电默认是上拉输入,可以修改吗?

CC2541 的是所有引脚复位后的状态是具有上拉电阻的通用I/O输入 这个默认状态可以修改吗?

Viki Shi:

可以的,请按照数据手册第七章修改:

http://www.ti.com.cn/cn/lit/ug/swru191f/swru191f.pdf

da qin zheng sheng:

可以的,注意p1.0,p1.1引脚内部没有上拉电阻,需要外接的。

user1354758:

回复 Viki Shi:

怎么改?

Viki Shi:

回复 user1354758:

The registers PxSEL, where x is the port number 0–2, are used to configure each pin in a port as either a general-purpose I/O pin or as a peripheral I/O signal. By default, after a reset, all digital input/output pins are configured as general-purpose input pins.

To change the direction of a port pin, the registers PxDIR are used to set each port pin to be either an input or an output. Thus, by setting the appropriate bit within PxDIR to 1, the corresponding pin becomes an output。

When used as an input, the general-purpose I/O port pins can be configured to have a pullup, pulldown or three-state mode of operation. By default, after a reset, inputs are configured as inputs with pullup. To deselect the pullup or pulldown function on an input, the appropriate bit within the PxINP must be set to 1. The I/O port pins P1.0 and P1.1 do not have pullup or pulldown capability. Note that pins configured as peripheral I/O signals do not have pullup or pulldown capability, even if the peripheral function is an input

user1354758:

回复 Viki Shi:

after a reset, inputs are configured as inputs with pullup. 就是这句话,能不能设置之后,变成after a reset, inputs are configured as inputs with pulldown,或者 output low。

Viki Shi:

回复 user1354758:

这个不行,初始化以后芯片IO会恢复初始状态,你可以在之后更改IO口的配置

赞(0)
未经允许不得转载:TI中文支持网 » CC2541 的IO 上电默认是上拉输入,可以修改吗?
分享到: 更多 (0)