Monday, 30 July 2018

digital logic - Putting an ESP8266 to sleep via either of two signals


I've got a circuit which I'm hoping to use to shut down my ESP, except where an interrupt happens from an external chip (MCP23008 GPIO expander), or I have chosen to manually keep myself enabled.


ESP schematic extract


Being a bit cheap, I wanted to do this using diodes - D1 is being fed from the interrupt line on the MCP23008, and D2 is being fed from another GPIO pin on the ESP. It seems that this works for keeping the pin held high (the ESP boots just fine on power up, when the INT pin is high by default, then I bring the GPIO pin high to keep it up), however when the interrupt pin goes low (I set it to Active-High mode), and I turn off the GPIO, the pin remains at 3.3V - even though the two sources on the other side of the diode are now at 0V. Clearly the capacitance on the input is retaining the charge and there's nowhere for it to go.


So I've put a 1K2 pull-down resistor in - however this doesn't seem to have quite the desired effect, and the pin sits at about 2.5V (3.3 - diode drop, more or less) and the CPU does not appear to run. I'm not sure if it's just because the pull-down is too strong.


What is the correct solution here, and can it be done with just diodes and/or MOSFETs (and passives)?


EDIT: this is a followup to ESP8266 Wake from deep sleep with an interrupt (not a duplicate as the question is different)



Answer



enter image description here



Figure 1. Schottky diode IV curves. Source: CMLSH05-10DA datasheet.


If you want to use diodes for the OR gate you could consider Schottky diodes which have a lower forward voltage drop. If you were to aim for a 350 mV drop at 25°C you should restrict the current to 0.3 mA. \$ R = \frac {V}{I} = \frac {2.95}{0.3} = 10 \; kΩ \$.




As an aside, does anyone know why the 25°C curve is between 125°C and 40°C?


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...