Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By cems
#54407 I have a Huzzah ESP-12E wired to an FTDI usb-serial board.

To upload a sketch, I have to momentarily press the reset button while holding the Flash button. I have to keep holding the flash button until the sketch upload starts then I can let it go.

This is inconvenient, and one can compare it to the nodeMCU board which simply accepts the uploaded sketch without any button magic. This uses a 2 transistor flip flop. I don't understand why it works and I'd like a simpler solution.

from googling a bit it looks like there might be a way to use DTR from the FTDI to get the Huzzah to automatically accept sketches.

I tried connecting DTR to RST and FLASH (GPIB0) and that didn't work. When I connected it just to FLASH then it still required me to press the RST button manually. And moreover, the results here were not completely consistent. Sometimes the upload would not work when wired that way, and sometimes it would. SO EVIDENTLY I DON'T KNOW HOW THESE SIGNALS WORK QUITE RIGHT.

Can someone help me understand how to get this to just let me upload a sketch without pushing any buttons or worse holding buttons till the IDE uploads?.
Last edited by cems on Mon Sep 05, 2016 1:14 pm, edited 2 times in total.
User avatar
By cems
#54487 1) I don't have a RTS line on my FTDI breakout board so that's a non-starter. (it has CTS instead).
2) Was hoping for a less part hungry solution, especially one not involving discrete transistors.
3) it seems like there's a vastly simpler way to do this: I've been trying to connect DTR to gpib0 and reset to DTR with a capacitor.

So far this is not working. Since this should work given what I understand, I'm not sure why it does not. I'm thinking it may he a question of wrestling the right R and C for pull ups to get the timing right. But I'm also thinking I'm not understanding how this is supposed to work. Hence my question.
User avatar
By cems
#54494 Okay I Sort of solved the problem for the HUZZAH, at least when working with the Arduino loader.

I still have some things I don't understand:
I wish I knew why the capacative soluiton fails for me.

I wish I understood why the transitor flipflop method doesn't mess up when you open a serial monitor.

my FTDI only had CTS available directly, which is an input. I needed RTS which is an output. So I broke out the RTS on my board. Then I connected it to either Reset or EN, and DTR to GPIB0. In this configuration the Arduino IDE can program the Huzzah without having to press the flash and reset buttons.

Yeah!

But The major downside of this solution is that it resets the board if you open the serial monitor without disconnecting the connections. ;-(

Why Doesn't the transistor flipflop method have the same problem?

Googling around on this I learned a few things to consider for the Huzzah and for different boards
1. it may be better to drive EN than Reset. Some people have commented that RESET may be neccessary for the WAKE command from Pin 16 timer. So you don't want to tie it up. On some boards those two pins EN and RESET may acutally be wired together requiring cutting a trace to make them separate.

2. Some software drivers actually manipulate RTS. If they do they may not be doing what you want. What you want is for DTR to go low, then while it's low, a short low going pulse on RTS. and then it's extremely important that RTS never goes low again otherwise you may reset the board! It appears the ardunio IDE using windows 10 does the right thing.
A) if your software driver does not do the right thing then here is another way to solve the problem. You ignore RTS and connect DTS to reset or EN with a 100nanfarad cap. that value depends on the pullup resistor. this strategy is discussed here but I never got it to work with the Huzzah.
https://hallard.me/esp8266-autoreset/




(warning: there is a also danger not mentioned in the article if you capacitively couple. You need to have diodes to clamp the voltage on the reset or CE pin to less than Vcc. otherwise the positive going spike due to the capacitive coupling will effectively double the voltage in reset, and may overvolt the ESP8266.)