Hitting an issue with ECLIPSE on the PC and the TERMINAL program.
So in our little board we’re using an ATTINY85 to control the programming process for the ESP12s…
I have some issues..
If you’re using GPIO as an output to a relay… this whole process can cause the relay to click… the last thing you want to do if you have a lamp or heating system on that output.
Keeping things simple with 5v relays you really need to use an NPN transistor so just basing stuff on the 3v line is out.
In the ECLIPSE programming environment when programming, DTR goes low as does RTS, then RTS goes high, then DTR goes high then you program the chip. You can control all of that in ESPTOOL.PY
In the TERMINAL program addon for Eclipse, opening the terminal causes DTR to go LOW, HIGH, and LOW and STAY LOW!!!!
So my thoughts are to buffer the GPIO output to the relay via the TINY. On powerup the TINY output to relay is LOW…
So if the TINY sees DTR go low, it would pull both DTR and RESET LOW… if DTR STAYS LOW for more than a second… GPIO-0 is floated (Tiny pin becomes input) then RESET is floated (tristate on the Tiny) and from that point on the relay output follows the input from GPIO until DTR goes high then low and we start again.
If on the other hand DTR goes low then high, we assume programming, release RESET first then GPIO-0… then we wait for no serial activity for a couple of seconds before resetting again and then following GPIO-0….
Make sense? I can’t find any way to control DTR on that Terminal program so this is the best I can come up with for now…