0
\$\begingroup\$

I'm working on a project which is all on breadboard right now. I'm close to final version, so I'm planning to design PCB for the release (not commercial use, just for some friends of mine).

The microcontroller is an ESP8266-12E, and I want to be able to program it after it has been soldered to PCB (so ICSP). To achieve that, I planned a pin-strip to expose:

  • RX
  • TX
  • GPIO0
  • GPIO2 (not sure about that, some schematic don't use it)
  • GPIO15
  • CHPD
  • VCC
  • GND

according with programmer schematics you can found online (eg. this or this).

This is how 'programming relevant' pins are used in my project:

  • RX and TX pins are used for a GPS module connection.
  • GPIO2 used as 'debug serial'
  • GPIO0 used as output
  • GPIO15 not used

I never worked with ICSP so I'm quite confused about some points:

  1. Resistors in programmers schematics (like the second link I post): should I put them on the programmer board (which will be then connected to pin-strip with a cable to program) or should be placed into the PCB?

  2. Are there any other PCB/schematic design guidelines I must to know to safe perform an In-Circuit-Programming procedure without damage other PCB device/IC or the microcontroller? (eg. pull-up/down, decoupling, etc)

\$\endgroup\$
  • \$\begingroup\$ Are the RX, TX pins otherwise connected to other components, except for the "pin-strip" for programming? What about the GPIOs? If not, there is no concern. And which resistors do you mean? \$\endgroup\$ – nickagian Jun 27 '17 at 10:36
  • \$\begingroup\$ I added pin use in the question description :) Concerning the resistors, if you see some online schematics (like the second link I put in the question) they use resistors (eg. 10K on the CHPD pin instead to connect to 3.3V directly. \$\endgroup\$ – Noisemaker Jun 27 '17 at 12:00
1
\$\begingroup\$

First you need to understand which and how these GPIOs are used. You can also check this. In practice, for normal operation and boot from the flash memory, GPIO15 should be LOW, and GPIO0 and GPIO2 should be HIGH at start-up. When you want to load a new image, all you have to do is pull GPIO0 to LOW state during startup, while the two other GPIOs remain as previously, and then the ESP8266 is ready to receive the program over the UART interface.

Additionally, CHPD should be HIGH at all times, otherwise the IC will not run at all. CHPD stand for "CHip Power Down" and although it is badly named, it is active low.

Now, to bring the ESP8266 in the start-up mode which is necessary when you want to program it, you either have to remove power and apply again, send a LOW pulse on the RST pin or send a LOW pulse on the CHPD pin.

Thus, the pull-up/pull-down resistors that you mention should be put on the main PCB. They are, anyway, necessary for the normal operation of the board (like the pull-up on the CHPD pin). Do not rely on the internal pull-up/pull-downs that may be present in the IC.

From the above you can also see that basically only GPIO0 and the UART interface are really necessary for programming the ESP8266. There is no need to use GPIO15 and GPIO2. And the CHPD could be used to reset the IC, but this is not necessary, since you could do the same by removing and re-applying the power supply.

From these pins, I think only the UART interface should be looked closely in your case, since you have it connected to another IC already. If I were you, if I wanted to be 100% sure, I'd probably use some way of interruption (e.g. jumpers or switches) between the ESP8266 and the GPS module. During normal operation you will keep the two ICs connected. But when you want to load a new image, you will need to interrupt this connection so that there is not interference from the GPS module to the signals from your programmer that could make the loading process to fail.

One last friendly advice! Before doing your PCB, just test the circuit you want to implement on the breadboard and confirm it works or do the necessary modifications!

\$\endgroup\$
  • \$\begingroup\$ Right now I use ESP8266 NodeMCU LUA Amica board to develop. You can find schematic here: raw.githubusercontent.com/nodemcu/nodemcu-devkit/master/… . My idea is to de-solder ESP8266 from the board, solder cables to the pads and create a sort of programming header to attach to the pin-strip. Should it works? \$\endgroup\$ – Noisemaker Jun 27 '17 at 13:12
  • \$\begingroup\$ Although I haven't quite understood what you intend to do exactly, the idea of de-soldering the board and soldering wires on the pads should work. \$\endgroup\$ – nickagian Jun 28 '17 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.