GPIO16 and setting RST line
-
- Posts: 28
- Joined: Tue Mar 31, 2015 7:27 pm
GPIO16 and setting RST line
Postby geo.espressif » Mon Dec 14, 2015 5:11 pm
Could anyone help me with some code to set GPIO16 low, it appears to be interfering with our ability to reset the device (it's causing a fight over reset line being low/high). There don't seem to be any register definitions for it in eagle_soc.h
James
James
Re: GPIO16 and setting RST line
Postby dkinzer » Wed Dec 16, 2015 11:51 pm
For future reference, the Arduino-ESP8266 code is a good place to begin researching how to accomplish something on the ESP8266.geo.espressif wrote:Could anyone help me with some code to set GPIO16 low
To use GPIO16, you must map it to be an I/O pin somewhere in your initialization:
Code: Select all
uint32_t val;
// map GPIO16 as an I/O pin
val = READ_PERI_REG(PAD_XPD_DCDC_CONF) & 0xffffffbc;
WRITE_PERI_REG(PAD_XPD_DCDC_CONF, val | 0x00000001);
val = READ_PERI_REG(RTC_GPIO_CONF) & 0xfffffffe;
WRITE_PERI_REG(RTC_GPIO_CONF, val | 0x00000000);
Then, to set GPIO16 high or low:
Code: Select all
// set the pin state first, then enable output
val = READ_PERI_REG(RTC_GPIO_OUT);
WRITE_PERI_REG(RTC_GPIO_OUT, pinHigh ? (val | 1) : (val & ~1));
val = READ_PERI_REG(RTC_GPIO_ENABLE);
WRITE_PERI_REG(RTC_GPIO_ENABLE, val | 1);
For completeness, this is how you read GPIO16 as an input:
Code: Select all
// set as an input
val = READ_PERI_REG(RTC_GPIO_ENABLE);
WRITE_PERI_REG(RTC_GPIO_ENABLE, val & ~1);
// read the input state
val = READ_PERI_REG(RTC_GPIO_IN_DATA) & 1);
Don Kinzer
Beaverton, OR, USA
Beaverton, OR, USA
-
- Posts: 28
- Joined: Tue Mar 31, 2015 7:27 pm
-
- Posts: 1
- Joined: Fri Mar 11, 2016 4:23 pm
Re: GPIO16 and setting RST line
Postby fengwanjun » Sat Mar 19, 2016 10:36 pm
I use your code .
But like the old ones. When gpio16_output_set(0),it goes like a system reset.
Why????
But like the old ones. When gpio16_output_set(0),it goes like a system reset.
Why????
Who is online
Users browsing this forum: No registered users and 188 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.