ESP32 Wroom-32 board GPIO25 can't be INPUT

xiangcheng
Posts: 29
Joined: Mon Feb 20, 2017 2:27 am

ESP32 Wroom-32 board GPIO25 can't be INPUT

Postby xiangcheng » Thu Jul 19, 2018 1:57 pm

Hi, I'm developing sensors application for customer with ESP32 WROOM-32 board which is bought from official site of ESPressif. I'm using a standard function which sets pin to input or output.
The issue on my board is: GPIO25 is always high when I set it as INPUT mode and use gpio_get_level(25).
I can set GPIO 18, 19 , 22, 23 as INPUT and they works well. But for GPIO25, it is always high. Did I miss anything? any hardware limitation?

Some log from gpio.c is: I think it is right. Please give some advice thanks.

Code: Select all

I (126) gpio: GPIO[25]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Wroom-32 board GPIO25 can't be INPUT

Postby ESP_Sprite » Fri Jul 20, 2018 10:04 am

There is absolutely nothing special about GPIO25, from what I know. What board specifically do you use? DevkitC, Wrover-Kit, ...?

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: ESP32 Wroom-32 board GPIO25 can't be INPUT

Postby Vader_Mester » Fri Jul 20, 2018 11:51 am

The pull-up is enabled on this pin.
I (126) gpio: GPIO[25]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0

This means that it will be high unless something shorts it down to ground.
In this case, since it is an input, your external circuitry that outputs to this pin must pull this down to ground, in order to make this pin "become zero".

You should check, that the circuit that outputs to this pin is in fact pull-capable, and what kind of output it has, so it can in fact short it to ground.
If the circuitry can't pull it to GND "strong" enough, then the pin will remain above 0 volts. If you try to set this pin to 0 with your circuit, and the resistance between the pin and ground is comparable with the internal pull-up resistance in the ESP, then the voltage on this pin (using the standard voltage devider equation) can keep the voltage on the pin above the low detection treshold.

Vgpio = Vhigh * Rtognd /(Rpullup * Rtognd).
In order for this pin to see a strong "0", you will need to be 0,8V or below (in case of a 3,3V supply to the ESP).
I'm not sure what's the resistance value of the internal pull-up though.

Try to turn off the internal pull-up and see what happens.

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

xiangcheng
Posts: 29
Joined: Mon Feb 20, 2017 2:27 am

Re: ESP32 Wroom-32 board GPIO25 can't be INPUT

Postby xiangcheng » Mon Jul 23, 2018 3:16 am

Thanks above 2 BIg-Niu.

I use DevKit which is bought from official site and connected some sensors and LCD screen to combine one under-developing board. I will change the hardware board since it seems to be some "short" issue which is unknown to me. Thanks alot.

Who is online

Users browsing this forum: Baidu [Spider], ESP_Sprite and 208 guests