Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

ESP32 RTS/DTR MOSFET setup / CP2102N USB IC
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ESP32 RTS/DTR MOSFET setup / CP2102N USB IC

by Tuege on Mon Jul 13, 2020 7:06 pm

Hey everyone,
I recently designed a PCB with an ESP32-D0WDQ6 onboard (reference layout) and orientated myself on the HUZZAH32. Specifically using the reset/GPIO0 setup with the two mosfets. I did however upgrade the CP2104 to a newer CP2102N which should theoretically be pin compatible. The setup is as follows in the pictures. The USB chip gets recognised and a COM port gets assigned (I can even program the USB chip) but when I try to upload code to the esp32 I get a 'Failed to connect to ESP32: Timed out waiting for packet header' error.

My Question: Is there anything wrong with my design (I have attached snippets of the waveforms of the RTS, DTR, GPIO0 and RESET lines during the attempt to program) or do I simply need to configure the CP2102N correctly to work correctly with the adafruit HUZZAH32 board files? (I am using the Arduino IDE with the HUZZAH32 board files). What does the setup of the CP2104 on the HUZZAH32 look like in SimplicityStudio?

Thanks in advance
Tuege
Attachments
ESP32.JPG
ESP32.JPG (140.1 KiB) Viewed 30 times
CP2102N.JPG
CP2102N.JPG (109.61 KiB) Viewed 30 times
ESP32 Capture.JPG
ESP32 Capture.JPG (245.88 KiB) Viewed 30 times

Tuege
 
Posts: 2
Joined: Mon Jul 13, 2020 6:19 pm

Re: ESP32 RTS/DTR MOSFET setup / CP2102N USB IC

by adafruit_support_mike on Wed Jul 15, 2020 5:22 pm

It looks like Q3 has a pair of connections swapped.

Each transistor is half of an XOR gate:

- GPIO0 and RESET should both stay high if DTR and RTS are both high, or both low.
- GPIO0 should only go low when DTR is low and RTS is high.
- RESET should only go low when DTR is high and RTS is low.

The traces show GPIO0 falling a little below 1V when DTR is high and RTS is low, which shouldn't happen. The behavior is what I'd expect at the base of Q4, assuming the circuit is built with NPN bipolar junction transistors like in the schematic. It doesn't match any combination of signals I'd expect from a circuit using n-mosfets.

adafruit_support_mike
 
Posts: 61422
Joined: Thu Feb 11, 2010 2:51 pm

Re: ESP32 RTS/DTR MOSFET setup / CP2102N USB IC

by Tuege on Sat Jul 25, 2020 7:46 pm

adafruit_support_mike wrote:It looks like Q3 has a pair of connections swapped.


Thanks so much that seems to be solving that issue and now the RTS, DTR, Reset and GPIO0 lines behave themselves (after also swapping out the ESP32 chip since I was getting weird behaviour on the Reset line. The waveforms now look as shown in the pictures but although the CP2102N seems to send commands to the esp32 chip, the esp32 doesn't seem to react at all.

I'm using an ESP32-D0WDQ6 with a GD25Q32CNIGR flash chip (different form factor than in the reference design but should have same specs). When I try uploading a sketch the USB-to-UART bridge (CP2102N) sends the message shown in the "UART Rx" picture but the ESP32 doesn't respond (Tx line constantly low) and I get this error message 'A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header'. I've attached the settings I am using in the Arduino IDE but I am not sure whether this is to do with the settings on the CP2102N or in the Arduino IDE. Do I need to flash the ESP32 with a bootloader or something before I can upload using the UART0?
Attachments
Settings.png
Settings.png (48.48 KiB) Viewed 14 times
UART Rx.png
UART Rx.png (17.35 KiB) Viewed 14 times
Fixed Q3 and Reset.png
Fixed Q3 and Reset.png (100.93 KiB) Viewed 14 times

Tuege
 
Posts: 2
Joined: Mon Jul 13, 2020 6:19 pm

Please be positive and constructive with your questions and comments.