Arduino USB-UART with CP2102 [SOLVED] - Page 1
Forum section: electronics / projects

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 19, 2017, 07:48:40 pm
content: hi All,I just testing a USB to UART/TTL module from ebay that i received today. Unfortunately i can't get it to work. It is being detected by the Laptop but when uploading a sketch to the arduino it resets the Arduino and nothing happens.I would appreciate if anyone can help me with configuring it to work with the arduino. The pin connections from module to Arduino are as followsRX -> RXTX -> TXDTR -> RST (Reset PIN on Arduino)GND -> GND5V - NC

author: cdev
author_rank: Super Contributor
timestamp: November 19, 2017, 07:54:05 pm
content: I would start withRX -> TxTX -> RxGND -> GND5V - NC (unless the device you are using needs power and doesnt have it - leave this unconnected.)As far as the flow control pins, check your docs.. Many USB-UART settings don't use them.I use my USB-UART dongle that has the CP2102 a lot and its rare that a device uses the extra pins. (although its always good to have them)Some MCUs are 3..3 volt too..

author: sleemanj
author_rank: Super Contributor
timestamp: November 19, 2017, 08:31:47 pm
content: What arduino exactly?Tx and Rx must cross overA 100nF cap in *series* between DTR and reset is advisable

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 19, 2017, 10:51:01 pm
content: Yes tx of CP to rx on uno and rx of CP to tx on uno and connecting the pin named DTR to RTS has solved this problem don’t forget to break the default DTR trace on the module.Www.Georgehobby.wordpress.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 19, 2017, 10:55:33 pm
content: Quote from: sleemanj on November 19, 2017, 08:31:47 pmI have the 100nf in series with RST on the uno which has female headers. I've reattached the PIC with a clear marking of the new connection from DTR pin RTS.Www.Georgehobby.wordpress.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 19, 2017, 11:26:43 pm
content: so would it be ok to have the RTS from the CP2102N connected to the RST pin on the Uno with a 100nf series cap ? Just wanted to clear that doubt before i get my board fab'd.

author: Peabody
author_rank: Super Contributor
timestamp: November 20, 2017, 12:52:50 am
content: Seems to be some confusion about RTS vs RST. RTS (Request To Send) is an output of the CP2102 like DTR. RST is the reset pin of the Arduino's processor. I would guess that the Arduino software only uses the DTR line to reset the processor. If that is true, then connecting RTS to RST would have no effect. Your scope, or even an LED rig, would tell you which output the software toggles to reset the Arduino. But my guess is it's DTR, not RTS, that you should connect to RST, as you have already done.Also, I believe the CP2102 outputs, including TXD, DTR and RTS, are all 3.3V. But you say it works, so your Arduino is probably also 3.3V, although that might be high enough to work with a 5V Arduino, even if it isn't a perfect match.

author: retrolefty
author_rank: Super Contributor
timestamp: November 20, 2017, 12:58:11 am
content: Quote from: Peabody on November 20, 2017, 12:52:50 amThe Arduino IDE sends both DTR and RTS when it wishes to reset the proper COM attached board. This was for legacy reasons for very early boards. So either one can be used to accomplish the automated reset before uploading to the chip.

author: sleemanj
author_rank: Super Contributor
timestamp: November 20, 2017, 04:17:31 am
content: Quote from: anishkgt on November 19, 2017, 11:26:43 pmYes that should be fine. The cap is just to make sure it doesn't hold it low (too long).Quote from: retrolefty on November 20, 2017, 12:58:11 amTo be pedantic,avrdude is what does that, the IDE just tells avrdude to use the arduino protocol.

author: Peabody
author_rank: Super Contributor
timestamp: November 20, 2017, 10:27:29 pm
content: While we're on this, I'd like to ask about the series capacitor on the DTR-to-RST connection. I see this pretty widely used, so I have to assume it works, but I'd like to understand why. Of course I understand how it generates the reset, but I don't understand why it doesn't blow up the processor when DTR goes back high.If DTR stays low long enough for RST to go back high through the pullup resistor, then the cap will be charged to almost 3.3V. Then when DTR goes back high, the other end of the capacitor will be shifted to nominally 6.6V, which I suspect exceeds the absolute maximum value for voltage applied to RST, or to any pin for that matter. So in effect the capacitor appears to be a single-stage charge pump doubler.Is it just that the protection diode on RST takes care of this spike, and "absolute maximum" isn't really the absolute maximum? Or is it just assumed that the designer will add a zener diode to ground at RST that shunts the spike to ground? Or I guess the other possibility is that for some reason the spike isn't generated.Well, if someone could clarify this for me, I would appreciate it.

author: Monkeh
author_rank: Super Contributor
timestamp: November 20, 2017, 11:36:20 pm
content: Quote from: Peabody on November 20, 2017, 10:27:29 pmBecause the reset pin is high-voltage tolerant as it's also used to trigger parallel programming.... this is why the Arduino went through this enjoyable phase of becoming dead to the world when the charge pump stuck it into parallel programming mode. These days they clamp it to Vcc.