Author Topic: Arduino USB-UART with CP2102 [SOLVED]  (Read 7932 times)

0 Members and 1 Guest are viewing this topic.

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Arduino USB-UART with CP2102 [SOLVED]
« on: November 19, 2017, 07:48:40 pm »
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 follows

RX -> RX
TX -> TX
DTR -> RST (Reset PIN on Arduino)
GND -> GND
5V - NC
« Last Edit: November 20, 2017, 06:40:55 am by anishkgt »
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Arduino USB-UART with CP2102
« Reply #1 on: November 19, 2017, 07:54:05 pm »
I would start with

RX -> Tx
TX -> Rx

GND -> GND
5V - 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..
« Last Edit: November 19, 2017, 07:57:50 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Online sleemanj

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Arduino USB-UART with CP2102
« Reply #2 on: November 19, 2017, 08:31:47 pm »
What arduino exactly?

Tx and Rx must cross over

A 100nF cap in *series* between  DTR and reset is advisable

~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: Arduino USB-UART with CP2102
« Reply #3 on: November 19, 2017, 10:51:01 pm »
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.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: Arduino USB-UART with CP2102
« Reply #4 on: November 19, 2017, 10:55:33 pm »
What arduino exactly?

Tx and Rx must cross over

A 100nF cap in *series* between  DTR and reset is advisable


I 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.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
« Last Edit: November 19, 2017, 11:16:53 pm by anishkgt »
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: Arduino USB-UART with CP2102
« Reply #5 on: November 19, 2017, 11:26:43 pm »
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.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: us
Re: Arduino USB-UART with CP2102
« Reply #6 on: November 20, 2017, 12:52:50 am »
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.
 
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Arduino USB-UART with CP2102
« Reply #7 on: November 20, 2017, 12:58:11 am »
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.

 The 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.

 

Online sleemanj

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Arduino USB-UART with CP2102
« Reply #8 on: November 20, 2017, 04:17:31 am »
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.

Yes that should be fine.  The cap is just to make sure it doesn't hold it low (too long).

The Arduino IDE sends both DTR and RTS when it wishes to reset the proper COM attached board.

To be pedantic, avrdude is what does that, the IDE just tells avrdude to use the arduino protocol.

~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 
The following users thanked this post: anishkgt

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: us
Re: Arduino USB-UART with CP2102 [SOLVED]
« Reply #9 on: November 20, 2017, 10:27:29 pm »
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.

 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 8041
  • Country: gb
Re: Arduino USB-UART with CP2102 [SOLVED]
« Reply #10 on: November 20, 2017, 11:36:20 pm »
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.

Because 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf