0

I don't have my USB type A cable to program my UNO, I would like to program it via a NodeMCU ESP8266.

Maybe with the TX and Rx pins, I've seen people program certain versions of ESP with a UNO board.

How do I do this and is it possible?

0

1 Answer 1

1

The UNO's USB connection is little more than a USB to UART converter. The NodeMCU's USB connection is also little more than a USB to UART converter.

With a little jiggery pokery (yes, that's a technical term) you can replace one with the other.

By keeping the NodeMCU in RESET mode (tie the EN pin low, or hold the RESET button) you can use the TX and RX pins as the output to the onboard USB to UART converter to connect to the TX and RX pins of the Arduino.

The tricky part is getting the Arduino to reset at the right time: you have to press the Arduino's RESET button at just the right time. Normally this is done by a small capacitor between the DTR signal of the USB to UART converter and the RESET pin, but you don't have access to the DTR signal, so you will have to do it manually. Timing here is everything. Press upload, and just as AVRDude starts to execute you press RESET. Having verbose compilation turned on in the IDE can help.

It may take a few attempts to get it right.

5
  • Just for clarification, as I'm a beginner... TX goes to RX and vise versa, right?
    – Coder9390
    May 20, 2021 at 13:43
  • And should the target be UNO or NodeMCU?
    – Coder9390
    May 20, 2021 at 13:45
  • 1
    No, TX goes to TX and RX to RX. You're mirroring the NodeMCU functions with the Arduino board. And the target is UNO, since that's what you're programming. The NodeMCU ceases to be an NodeMCU and is merely a USB to UART adaptor (like an FT232 cable).
    – Majenko
    May 20, 2021 at 14:00
  • 1
    I cannot believe my eyes, IT WORKED!
    – Coder9390
    May 20, 2021 at 14:15
  • Congratulations.
    – Majenko
    May 20, 2021 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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