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.

CC2540 P0.7口做为输入时引脚电平不为0




定义P0.7为输入口外部下接22K做为电平输入检测

#define AdfDetPin(P0_7)
#define AdpDetPinPort (P0SEL &= ~BV(7))         //定义为GPIO功能
#define AdpDetPinInPut (P0DIR &= ~ BV(7)) //定义为方向输入

程序执行:

 AdpDetPinPort ;

 AdpDetPinInPut ;

后打断点测量IO口还有1.4V左右的电平,

如果定义为输出口,输出高中低电平正常,

看样子是内部有上接电阻的样子。

P0.6口同样存在这样的问题。是不是哪里可以关上拉?怎么关呢,找半天没有找到