esp8266 GPIO input configuration
The following code, when used in user_init() will enable the internal pullup on GPIO0 and read it’s value. Unfortunately GPIO0 (and GPIO2) when held low at boot put the device into a non-running mode (firmware update), I’ve also been unsuccessful in using the internal pulldowns on these pins. This means these pins can not be used for user mode selection at boot, using the internal pullup/down resistors. And unfortunately, those are the only GPIOs available on the simplest modules. It maybe possible if an external pulldown is installed.
1 2 3 4 5 6 7 | gpio_init(); PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0); PIN_PULLUP_EN(PERIPHS_IO_MUX_GPIO0_U); os_delay_us(10000); int config = GPIO_INPUT_GET(0); //GPIO_ID_PIN(PERIPHS_IO_MUX_GPIO0_U)); char buffer[30]; os_sprintf(buffer, "config: %d" ,config); |
i have this unusually problem where my gpio 2 is stuck at high and i can’t bring it to low, only at this one time i successfully program the esp to set gpio2 to low but never again.i am using a ftdi chip to power and program. Everything else works fine client, server etc I have also tried like two other new chips but gpio 2 stays high
I have this chip ——-
http://www.ebay.com/itm/ESP8266-Serial-WIFI-Wireless-Transceiver-Module-Send-Receive-LWIP-AP-STA-A-/201205524305?pt=LH_DefaultDomain_0&hash=item2ed8c8a751
when you are using the ftdi chip to power the esp, do you power it from 5V and drop it down to 3.3 with a regulator or use the on board 3.3 to power straight. if your answer is the second, then you may get errors, try using the 5V and drop it down with a 3.3 regulator like this, http://www.ebay.com/itm/5Pcs-DC-DC-4-5V-7V-to-3-3V-AMS1117-3-3V-Power-Supply-Module-Voltage-Regulator-/321526007055?pt=LH_DefaultDomain_0&hash=item4adc71850f – it may help ?!
IIRC, all of the normal GPIO pins only have internal pullups. The special GPIO16 (part of the RTC subsystem) only has an internal pullDOWN.
where does the output from os_printf go? How do you read it?