How does 8266 DevKit C autoprogrammer work?

Thread Starter

bmbouter

Joined May 29, 2021
55
I'm looking at the autoprogramming circuit from espressif's schematics (see page 2 Q1 and Q2). It's the latest official design from espressif so I take it as given that it works. It's intended to take DTR and RTS as inputs from the FTDI and drive the EN and GPIO0 lines. With EN and GPIO0 as the pins to put the 8266 in flashing mode I expect to see EN transition from 0 -> VCC while GPIO0 is 0V. This is also confirmed from experimentation myself, setting GPIO0 to 0V and then bringing EN to 0V isn't good enough, it won't actually boot into flash mode until EN transitions from 0V -> VCC while GPIO0 is 0V.

I modeled the circuit in LTSPICE (see attached image and asc file too). During flashing (using my oscilloscope) I see RTS go to 0 V for 100ms and then return to VCC just as DTR then goes to 0V for 50ms, which I also modeled. When measuring EN and GPIO0 I see GPIO0 going to 0V first (driven by RTS going to 0V first) and then EN going to 0V just as GPIO0 has its voltage returning to VCC (slowed by capacitors), see the visualization around the 200ms mark of simulation time.

I don't have the physical circuit in front of me, but it seems this won't work. By the time the EN pin transitions back to VCC the GPIO0 pin will also be at VCC which will have caused the 8266 to reset (by EN going to 0V and then back to VCC) but not into flashing mode.

Will this reference circuit work, and what am I misunderstanding to think it won't? As an alternative a circuit like this one seems like it definitely work, but it's not the reference on from espressif so that's strange.
 

Attachments

Thread Starter

bmbouter

Joined May 29, 2021
55
Well as soon as I wrote all this out I found the problem. In my simulation I had the DTR and RTS signals swapped in the simulation. Upon swapping them to their correct values that match reality I get the following chart instead, which shows GPIO0 going to 0V just as V(en) start to rise, which should correctly put the device into flashing mode.

Note the importance of the capacitors here, without which the EN pin will rise from 0V -> VCC quickly and GPIO0 will not become active low yet causing just a reboot instead of a reboot into flashing mode.
 

Attachments

Top