我在使用ESP8266-12模块作为一个控制器。 使用GPIO14来输出控制信号。具体工作情况是,通常情况下 GPIO14输出
低电平,8266每隔一段时间从deep-sleep 中醒来,如果判断符合条件就输出高电平。否则继续输出低电平。
根据用户手册,为了满足从deep-sleep的苏醒条件,reset管脚链接到了 XPD_DCDC 管脚。
在试验中发现,模块能够进入deep-sleep, 也能够唤醒。 但是在唤醒时,GPIO14 管脚变成了高电平,然后进入用户
程序后才被再次置为低电平。这样模块的工作变成了每隔一段时间就输出一个高电平脉冲了,这是不符合产品要求的
。我怀疑是 reset 期间,8266内部的硬件逻辑或启动代码产生了这样的结果。
我想请教 :
1)在硬件reset的时候,怎么保持GPIO原先的状态?
2) 在deep sleep 醒来的时候,能否让GPIO 保持原先的状态?
3)有些 GPIO 是和其他功能复用的, 能否让GPIO 在上述两种情况下,继续保持原先的配置,和输入/输出状态呢?
4)上面问题的解决是否只需要SDK编程就可以办到了? 能否给个样板代码?
谢谢。
关于 GPIO 的状态保持
Re: 关于 GPIO 的状态保持
Postby YimingLi » Tue Jun 09, 2015 12:09 pm
Hi,
Please see below with ==>
Please see below with ==>
jgong wrote:我在使用ESP8266-12模块作为一个控制器。 使用GPIO14来输出控制信号。具体工作情况是,通常情况下 GPIO14输出
低电平,8266每隔一段时间从deep-sleep 中醒来,如果判断符合条件就输出高电平。否则继续输出低电平。
根据用户手册,为了满足从deep-sleep的苏醒条件,reset管脚链接到了 XPD_DCDC 管脚。
在试验中发现,模块能够进入deep-sleep, 也能够唤醒。 但是在唤醒时,GPIO14 管脚变成了高电平,然后进入用户
程序后才被再次置为低电平。这样模块的工作变成了每隔一段时间就输出一个高电平脉冲了,这是不符合产品要求的
。我怀疑是 reset 期间,8266内部的硬件逻辑或启动代码产生了这样的结果。
==> During reset and just after reset out, the GPIO14 is output disabled but with an internal pull-up enabled (oe=0, wpu). You checked to find a high level on the GPIO14 pin before your firmware to config it possible due to this internal weak pull up. This might be the feature by the chipset itself not controllable by software/firmware(If you have some background to chipset design or at least HDL programming, you might understand it better).
我想请教 :
1)在硬件reset的时候,怎么保持GPIO原先的状态?
==> I don't think the chip has such a capability, since it is a reset and many registers will be reset into a reset-default value.
2) 在deep sleep 醒来的时候,能否让GPIO 保持原先的状态?
==> when exiting from deep sleep, XPD_DCDC output a low-to-high transient to nReset pin, that is, the exiting from deep sleep de facto is achieved by a hardware reset....
3)有些 GPIO 是和其他功能复用的, 能否让GPIO 在上述两种情况下,继续保持原先的配置,和输入/输出状态呢?
4)上面问题的解决是否只需要SDK编程就可以办到了? 能否给个样板代码?
==> please be kindly noticed that SDK is just to provide machine code that will be executed on the chip after the chip reset out. I am afraid if you expect to keep or restore the original states before "sleep", you may not be able to use the "deep sleep" function here. Or, you may have to save a copy of the states before you enter deep sleep externally and then re-config it at the initialization stage of firware.
I am not a guy from espressif. Therefore above information are just for your reference and should be verified by your own.
谢谢。
-
- Posts: 140
- Joined: Mon Oct 27, 2014 10:40 am
Re: 关于 GPIO 的状态保持
Postby Espressif_Kelly » Wed Jul 22, 2015 8:20 pm
Hi jgong,
deep sleep 状态下除了 XPD_DCDC,其他的 GPIO 口均是高阻态,IO 口上无电流,但是可以保持电平(当 IO 口外接的是 MOS 管)。
请知悉,谢谢!
deep sleep 状态下除了 XPD_DCDC,其他的 GPIO 口均是高阻态,IO 口上无电流,但是可以保持电平(当 IO 口外接的是 MOS 管)。
请知悉,谢谢!
Who is online
Users browsing this forum: No registered users and 12 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.