|
如题,STC15F104W ,P3.0初始化为输入,在没有接外部电路时,测试是3.0V电平,请问是正常吗?MCU 是5V供电·
void GPIO_config(void)
{
GPIO_InitTypeDef GPIO_InitStructure; //½á¹¹¶¨Òå
P35 = 0;
GPIO_InitStructure.Pin = GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_5; //Ö¸¶¨Òª³õʼ»¯µÄIO, GPIO_Pin_0 ~ GPIO_Pin_7, »ò²Ù×÷
GPIO_InitStructure.Mode = GPIO_OUT_PP; //Ö¸¶¨IOµÄÊäÈë»òÊä³ö·½Ê½,GPIO_PullUp,GPIO_HighZ,GPIO_OUT_OD,GPIO_OUT_PP
GPIO_Inilize(GPIO_P3,&GPIO_InitStructure); //³õʼ»¯
P35 = 0;
P32 = 0;
P33 = 0;
GPIO_InitStructure.Pin = GPIO_Pin_0|GPIO_Pin_4; //Ö¸¶¨Òª³õʼ»¯µÄIO, GPIO_Pin_0 ~ GPIO_Pin_7, »ò²Ù×÷
GPIO_InitStructure.Mode = GPIO_HighZ; //Ö¸¶¨IOµÄÊäÈë»òÊä³ö·½Ê½,GPIO_PullUp,GPIO_HighZ,GPIO_OUT_OD,GPIO_OUT_PP
GPIO_Inilize(GPIO_P3,&GPIO_InitStructure); //³õʼ»¯
P30 = 0;
}
|
|