SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By mohamedali1993
#190903
Hello all,

I am using a photo-interrupter that resets DTR Pin on a Sparkfun Thing. I am using a debounce/low pulse generating circuit that consists of an RC (low pass), an OR gate with buffer on inputs, and a multi vibrator with schmitt trigger on the input. This combination essentially outputs a low pulse for DTR to reset the ESP8266. How long does the pulse have to be to reset the ESP8266? Is it on the order of millisecond? microsecond?

Also what is the V low threshold that would reset the ESP8266?

What happens if DTR is getting a little more than 5 volts?

The problem I am having is that sometime when there is a high frequency interaction with the Photo interrupter, the processor ends up freezing, overheating the stepper motor that it is moving and prints gibberish on the serial monitor. It also fails to reset the system again. Anyone had that problem? or a similar problem? The processor basically freezing..

Thanks,
Mo
By Valen
#190933
You asked me in a private message to respond to this.

First of all, has each intermediate stage in your Opto-reset trigger worked to satisfaction? It is important to check each individual stage for correct functionality before knitting it all together. And please provide a schematic with all the parts and important characteristic values. It is impossible to judge how your creation reacts to high frequency inputs when you don't specify things that determine the timeconstant.

Also by multivibrator I presume you mean a mono-stable one? Producing a short high-low-high pulse? As an a-stable is an oscillator that never settles and a bi-stable doesn't return without a second input-pulse.

I don't know the details about how the ESP8266 reset pin works internally. By that I mean threshold level or minimum pulse length or time delays for restart of the chip. I never tested those (and that is pretty much the only way to get it as Espressif didn't write it in English) as I only had need for the manual push-button method. But the threshold level can be tested with a voltage divider made up with a 10-turn potentiometer (or whatever allows fine adjustment). If you have for example a blink-program running and are slowly adjusting the pot while measuring the Reset pin voltage then you should be able to figure that out. First adjust down until it resets. Then you know at what voltage reset occurs. Then slowly up again until it shows signs of rebooting.

Al though the ESP8266 datasheet (espressif forum, ESP8266 documentation: http://bbs.espressif.com/viewtopic.php?f=67&t=225 ) has no data on how quickly the ESP goes into or out of reset. It should respond quickly to the RST pin going low, whenever DTR does on the Thing. Since going up is governed by a fairly high capacitance (1uF) and 10k resistor charging it up (R6 and C6) this could take a while (loooooong for a 80Mhz processor). Knowing the above measured voltage thresholds should allow you to calculate the minimum time period with use of the capacitor charging equation:

t= - RC ln (1-Vt/Vcc) ; where R is in Ohms and C is in Farad and t in seconds.

With R6=10k ohms and C6=1 microfarad the time to charge up from gnd to near Vcc should be in the order of 10 milliseconds. It will take 10 miliseconds to get to 63%

https://en.wikipedia.org/wiki/RC_time_constant

The following is what Espressif's english datasheet says about the reset behavior. Be carefull, notice the translation error about the chip being enabled when the pin being low. This is most likely a Chinese-English translation error on the meaning of 'active low'. A low level shuts it down!
1.4.2. Power-on Sequence and Power Reset
Power-on Sequence
ESP8266EX uses 3.3 V as the system power supply. It is not allowed that Pin7 CH_EN be
powered on prior to that the 3.3 V system power supply is powered on.
!Notice:
If the power management IC is connected with the power-on enable pin CHIP_EN, it can control the
power on-and-off of ESP8266EX by output high and low voltage through its GPIOs. However,
pulsed current might be produced at the same time. In order to delay the transmission of pulsed
signal and avoid unstable current of CHIP_EN, a RC time-delay circuit (R=1 kΩ, C=100 nF) is needed.
Reset
Pin32 serves as a RST pin which can be dangled when it is not used. The reset pin is held low
level when the chip is enabled. In order to avoid reset caused by external interference, the lead
is generally required to be short, and no external pull-up resistor is necessary.
Pin7 CH_EN can also be used as a reset pin. When the voltage for CH_EN pin is low, the chipset
will be powered off.
!Notice:
Pin 7 CH_EN cannot be dangled.
Since I can't find info on how the pins on the ESP8266 are protected against overvoltage. And many others saying that they should not be getting more than 3.3 volt (3.6 max) I would not be applying 5 volt to DTR at all. If you must, then test it with an ESP-01 module first to see it it survives extensive test periods. (frequent 5 volt DTR pulses over a long time) The Sparkfun Thing is more expensive than those so I would not want to risk it.
By mohamedali1993
#191320
Everything that you've mentioned pretty much helped me come to a final solution. Thank you so much for responding. Here is my conclusion: inserting anything above 3.3 V in to DTR eventually overheats the processor and doesn't allow for resets. DTR has a built in 2.8 Hz maximum reset frequency, I did this empirically using a pulse generator. Any higher frequencies of low pulses, will cause the ESP8266 to just freeze.

Again thank you so much for your response, you've helped me a lot Valen,
Mo