-->
Page 1 of 2

Reset method, auto reset and i2c (ESP-01)

PostPosted: Mon Oct 24, 2016 6:18 am
by eketjall
Hi,

First post here, tried to search but couldn't find anything concerning my problem (which i thought I wouldn't be the only one to have)

To summarize; I'm using the Arduino IDE to program a ESP-01 module. So far so good.

What I would like to achieve (which I know is possible all parts by them self but maybe not all together at the same time) is Auto Reset when programming using FTDI adapter which exposes DTR and CTS line. Would love to have the Arduino IDE serial monitor working even with auto reset circuit in place. And finally use GPIO 0 and 2 for I2c together with auto reset without any buttons or jumpers etc.

It might be to much to ask from the ESP-01 module, but shouldn't be impossible really.

In theory I got it working, but I got stuck on the auto reset.
I have the hardware circuit working "manually" but not from the DTR line.
Where do I find the information on what reset method "ck" vs "NodeMcu" actually do with the serial lines (DTR/RTS)? When and how do they go High or Low etc in the different modes?
(And also information on all the other settings which isn't self explaining such as speed and flash size. Haven't search for the others yet though because everything is working except auto reset)

During my searches I saw somewhere that it was possible to turn of´f DTR/RTS for the serial monitor to get that part working together with auto reset, but I really didn't find out more than it should be possible in the Arduino IDE.
How is this achieved?

If I can sort those two things out (really the auto reset is the biggest problem) I can start testing and se if I can have i2c without problems from the auto reset circuit.

Thx
/Henrik

Re: Reset method, auto reset and i2c (ESP-01)

PostPosted: Tue Oct 25, 2016 4:11 pm
by eketjall
Ok. I didn't realy have the reset circuit working after all.
I couldn't get the reset to work on the RST pin so I tried CH_PD, but it turns out to be just intermittent.

But I hooked everything up to my scope meter from work and figured out what was wrong.
When using the auto reset circuit on the CH_PD pin I got lot's of noise and on the RST pin my "low puls" was much shorter than expected.

My reset circuit is DTR -> 100nf -> RST pulled high with 10k and DTR -> diode -> GPIO2 pulled high with 3k3

The low period on RTS should be ~1ms but was only like in the tens of micro seconds.
Ok, RTS seems to be internally (or at least on the ESP-01 borad) pulled up with 12k, but that in parallel with my 10k doesn't explain the short pulse.
I tried to put a 330nf cap instead of 100nf, which should give a 3 times longer pulse, it didn't. Longer but not near 3 times.
680nf didn't cut it either.
My bin of caps is quite empty, but I wacked a 4,7uf electeolyte in instead. That did the trick. Got a long 32ms effective low pulse on RTS.
So there is some internal/on board capacitance really playing a role here.

So now the auto reset works fine with just the DTR line as trigger (ck mode which at least pulls DTR low) .
Don't know why there is noise when the chip enters boot mode though.
Image

So only left to investigate if this also will work together with i2c on GPIO 2 and 0.

And also, the question if it's possible to disable the low DTR in Arduino Idé serial monitor.

Re: Reset method, auto reset and i2c (ESP-01)

PostPosted: Fri Nov 04, 2016 11:01 am
by mrburnette
My $4 LoLin NodeMCU works perfectly with Linux Mint... downloads and auto-reboot without ever touching the Reset/Program buttons.... 95% of the time. Sometimes, if the module is 'hung' in some weird never-never-land, I have to press the Reset button, press and hold Program, release Reset ... and download. Yea, a pain sometimes ... but really not a big deal.

The NodeMCU schematic is online.


Ray

Re: Reset method, auto reset and i2c (ESP-01)

PostPosted: Sat Nov 05, 2016 4:07 pm
by eketjall
I've got it working now on the ESP-01 with Auto reset and i2c without the need of pressing buttons or in other means changing the hardware.

Will post schematics when I have it available.