Author Topic: CP2102N UART not detecting on PC [SOLVED]  (Read 13435 times)

0 Members and 1 Guest are viewing this topic.

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
CP2102N UART not detecting on PC [SOLVED]
« on: January 15, 2018, 11:27:28 am »
Hi All,

I've just got my PCB fab'd but the USB interface does not seem to be working when connecting to my Laptop. I've attached the schematic, would appreciate if somebody could help me resolve this.

Datasheethttps://www.silabs.com/documents/public/data-sheets/cp2102n-datasheet.pdf

« Last Edit: January 17, 2018, 12:31:07 am by anishkgt »
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #1 on: January 15, 2018, 03:36:20 pm »
Can you be more specific about what's not working, or what is working?  Does the TX LED fire when you send data?  Or is the laptop not detecting the device at all?

 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC
« Reply #2 on: January 15, 2018, 03:37:56 pm »
Sorry I meant the laptop is not detecting it.


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #3 on: January 15, 2018, 04:57:49 pm »
My experience is with the CP2102, not the "N", and I've always had USB provide power to the chip.  So I may not be the best one to help with this.  But some things to check:

If it's recognized on any other computer, then it would be a driver problem on your laptop.

Your schematic doesn't show the origin of the +5V supply, but make sure it's turned on.

This will sound silly, but make sure the pinout of your USB connector is correct.

You should have about 3.3V at Vdd.

I'm not sure the resistor values on VBUS are right.  You have them both at 1K, which would give you 2.5V on VBUS.  But Figure 2.6 in the data sheet, and the note at the bottom of page 5, suggest that you need to have at least 2.7V for the chip to recognize that the bus is connected, and they show 22K and 47K as the resistor values, which would put you at 3.4V at VBUS when connected.

It's handy to have a few Ebay CP2102 modules handy for checking out drivers and such.  You plug one in, you get the USB-connected tone, and it shows up as a COM port in Device Manager.  They are $2 or less.


 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC
« Reply #4 on: January 15, 2018, 07:35:19 pm »
Thank you Peabody, Appreciate it.

The main reason of using a CP2012'N' and not CP2012 was that i did not find any circuits online with this IC that incorporated the TX and RX led which was important for me and the datasheet of CP2012 did not mention anything about it but the N model did till i bought a USB to upload sketch to my Arduino but tracing the pins was quite hard on an SMD so i just stick to what was mentioned in the 'N' datasheet.

Quote
]I'm not sure the resistor values on VBUS are right.  You have them both at 1K.....
I was just testing if that would work but turns out that was the problem here as far as i can see. Thanks for pointing it out.

Secondly would it be ok to power the USB side seperately by the source connected like for example a laptop or a desktop and still have the PCB running also at the same time and share the same GND plane as well ? Here the +5v comes from the PCB itself which is also used to the power Atmega328.

I was told that the USB and the PCB should not have different power supplies while running used the same power from the PCB.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #5 on: January 15, 2018, 10:46:15 pm »
The CP2102 doesn't have the LED output pins that the N has.  So designers have just put the LEDs on the TXD and RXD lines.  Apparently it worked ok so long as you didn't try to go too fast.  But the N will go much faster than the CP2102, so I think they had to put in the separate LED driver pins.  I think you picked the right one.

I don't think I understand what you're asking about power sources.  The problem with the VBUS pin is an example of what you have to think about when there are separate power supplies to different parts of the circuit.  In your circuit, you have the V+ source provided by the USB cable when it's connected, and you have the +5V supply from your circuit that powers the CP2102N.  The problem arises when you plug in the USB cable before you power up the N.  If USB V+ was directly connected to the VBUS pin, and if the cable is plugged in before the N is powered up, then there would be 5V on the VBUS pin when VREGIN is at zero volts.  That violates the Absolute Maximum ratings for voltage applied to any pin.  The resistor divider is supposed to mitigate that.

So anytime you have separate supplies, you have to consider the order in which things will be powered up.  If you powered the CP2102N from USB V+, then everything on the N side would power up at the same time, and you wouldn't need the VBUS resistors.  But then you would have a problem at  the other end with the CP2102N's pins TXD, RXD, DTR, and RTS connecting to the ATmega328 at 3.3V when the processor is still powered down.  You would have to check the 328's data sheet to see if that causes a problem.  I believe in that specific case that the 328 pins will tolerate that, but you would have to check. If my memory is right about that, you might want to look at powering the CP2102N from USB.

I should also say that one disadvantage of the way you have it set up now is that the CP2102N will be powered up when the 328 is powered up, and that may be wasting a lot of current if USB is only used occasionally.

One way to avoid all these problems is to have USB power up everything when it is being used, and switch off the 328's regular power supply.

One question - is your 328 a 5V part?  The CP2102N TXD, etc., will all be at 3.3V.  It might work anyway, but it would be better if they matched.


 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: CP2102N UART not detecting on PC
« Reply #6 on: January 15, 2018, 11:02:14 pm »
I should also say that one disadvantage of the way you have it set up now is that the CP2102N will be powered up when the 328 is powered up, and that may be wasting a lot of current if USB is only used occasionally.

A wasteful 195uA.

Quote
One question - is your 328 a 5V part?  The CP2102N TXD, etc., will all be at 3.3V.  It might work anyway, but it would be better if they matched.

It will work fine. There's no need to match voltages.
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC
« Reply #7 on: January 15, 2018, 11:32:07 pm »
If i understand, correct me if am wrong, a better design would be to power the CP2012N via the USB and i could avoid the voltage dividers there by reducing cost and BOM and the Tx and Rx would not be a problem either though they would be at different voltage compared to the 5v on the PCB used to power the Atmega328.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #8 on: January 16, 2018, 01:01:52 am »
If i understand, correct me if am wrong, a better design would be to power the CP2012N via the USB and i could avoid the voltage dividers there by reducing cost and BOM and the Tx and Rx would not be a problem either though they would be at different voltage compared to the 5v on the PCB used to power the Atmega328.

I'm not sure.  It would be a more typical design, but not necessarily better.  If you power the CP2102N from USB, then when that chip is powered down, if the TX and RX pins of the Atmega328 are high, you could have an Absolute Maximum problem  on the RX and TX pins of theCP2102N.  Then there is the issue of the RTS pin.  You show that as connected to RST.  Is that the reset pin of the Atmega?  If so, keep in mind that all the pins of the CP2102N will sink some current when it is powered down.  So if RTS is connected to an active-low reset pin on the Atmega, that may keep the Atmega in reset, which is not what you want.  The typical solution for that is to put a capacitor in series, so you can do a reset pulse, but there's no DC connection.

If Monkeh is right about the 195 uA and the 3.3V-5V issue, then except for needing the two resistors, your current design is pretty safe, and should work well.

If there is any voltage matching problem, I believe you can convert the CP2102N to a 5V device by driving Vdd with 5V - just connect Vdd to VREGIN.  That shuts down the 3.3V regulator, and drives all the chip internals and outputs at 5V.  I would be curious to know what others think of that idea.

 
The following users thanked this post: anishkgt

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: CP2102N UART not detecting on PC
« Reply #9 on: January 16, 2018, 01:03:43 am »
If there is any voltage matching problem, I believe you can convert the CP2102N to a 5V device by driving Vdd with 5V - just connect Vdd to VREGIN.

You cannot.
 
The following users thanked this post: anishkgt

Offline cstratton

  • Regular Contributor
  • *
  • Posts: 62
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #10 on: January 16, 2018, 01:11:21 am »
In addition to what has already been said

- for any malfunctioning or failing USB device, you should be checking the most low level host output.  For example with a Linux host, you'd look at dmesg right after plugging in the device.  Things like swapped D+ vs D- will typically show up there as the host tries to enumerate the device at the wrong speed, and various device firmware or electrical noise issues will cause an initial recognize but later errors.

- Any malfunctioning QFN IC needs to have the interface between the metalization and the PCB pads inspected under high magnification, often holding the board at an angle rather than straight on.  Even allegedly first rate assembly houses can fail to produce good results, especially if it's a new board design that might have less than ideal thermal properties, a bad paste mask, etc.  And of course hand assembly always needs to be verified.  Micro or mini USB connectors should be inspected, too.

- Always try a different cable, host, with or without a hub, etc...
« Last Edit: January 16, 2018, 01:13:47 am by cstratton »
 

Offline bitbanger

  • Regular Contributor
  • *
  • Posts: 161
Re: CP2102N UART not detecting on PC
« Reply #11 on: January 16, 2018, 03:25:18 am »
Haven't use the CP2102 in a while, so I don't recall the the capabilities. However if you want to power a target board via USB with over 100mA then you have to have the CP2xxx negotiate for the power first, then allow power to be switched through (and not before).

Here's an implementation with a different chip (FT232L) but same idea: Q1 doesn't allow USB 5V through to target board until "PWREN" is switched.



« Last Edit: January 16, 2018, 03:27:31 am by bitbanger »
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #12 on: January 16, 2018, 04:09:57 am »
If there is any voltage matching problem, I believe you can convert the CP2102N to a 5V device by driving Vdd with 5V - just connect Vdd to VREGIN.

You cannot.

Last year I ran across a batch of CP2102 modules from Banggood with micro-USB connectors on them.  All of their I/O pins were about 4.3V.  After lengthy discussions on the Silabs forum, we concluded that the explanation was that the modules had traces connecting /Reset (pin 9) directly to the USB 5V V+ line, instead of to Vdd where it belonged.  The 5V at pin 9 was passing through the protection diode, which was connected to Vdd, with a diode drop. So the entire innards of the chip were being run through that source.  The 3.3V regulator was effectively shut down since Vdd was already over 3.3V, hence no need to pass anything through. Cutting that trace, and leaving pin 9 floating, returned the I/Os to 3.3V.

The thing is, except for the 4.3V, everything seemed to work fine, at least at low current levels that didn't challenge that protection diode.

So I wondered whether just deliberately connecting the USB 5V V+ line to Vdd might convert the chip to a 5V part.  There may be all kinds of reasons why that won't work, but it did work at 4.3V, so I think there is some chance that it would work at 5V too.  But of course there's nothing in the data sheet that would suggest this is permissible.

So by the way, if you get a CP2102 module with micro-USB, check the "3.3V" voltage before connecting it to a 3.3V processor.

 
The following users thanked this post: anishkgt

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC
« Reply #13 on: January 16, 2018, 11:02:22 am »
Just to have better idea at where should be, i've attached the schematic of the Atmega with the CP2102N. i probably should have posted it earlier.

Quote
You show that as connected to RST.  Is that the reset pin of the Atmega ?
yes it is, the Reset pin is pulled up with a 10K resistor to +5 which is connected to the RST through 0.1uf cap on the CP2102N.
Quote
If so, keep in mind that all the pins of the CP2102N will sink some current when it is powered down.  So if RTS is connected to an active-low reset pin on the Atmega, that may keep the Atmega in reset, which is not what you want.
I doubt this would be a problem when the Atmega Reset pin is pulled up to +5 with a 10K in series.

So all comes down to two designs, existing one with a 22.1K and 47.5K voltage divider instead of the two 1K resistors connected to Vbus. Second would be bus powered (preferred) mentioned in Page 5 within the datasheet.

With the schematics attached, would there be any reason why bus powered would be a bad idea ? and is it ok to have separate plane for the USB side. Would it be a problem for the Rx Tx pins in anyway ?
« Last Edit: January 16, 2018, 11:12:16 am by anishkgt »
 

Offline sanwal209

  • Regular Contributor
  • *
  • Posts: 114
Re: CP2102N UART not detecting on PC
« Reply #14 on: January 16, 2018, 03:17:23 pm »
Why your voltage divider resistors are 1K? with Vbus 5V and both 1K resistors of voltage divider you will get 2.5V.  While in datasheet they used 24k and 47k which gives 3.1V. This could be the reason. Chip detects the PC by getting voltage on VBUS pin. Probably with that voltage divider you are not crossing the threshold.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #15 on: January 16, 2018, 05:47:17 pm »
So all comes down to two designs, existing one with a 22.1K and 47.5K voltage divider instead of the two 1K resistors connected to Vbus. Second would be bus powered (preferred) mentioned in Page 5 within the datasheet.

With the schematics attached, would there be any reason why bus powered would be a bad idea ? and is it ok to have separate plane for the USB side. Would it be a problem for the Rx Tx pins in anyway ?

I don't see any problem using the bus powered version.  The only theoretical problem is that if you power up the CP2102N via USB before you power up the Atmega, the 3.3V levels on Tx and Rx of the CP will exceed the voltage limits on the Atmega's Rx and Tx pins relative to the Atmega's Vcc, which at that moment will be at ground.  But you have 1K series resistors which will limit any current flow, so I think that's ok.  And you will see a lot of designs done that way.  And if you always power up the Atmega first, even that theoretical problem goes away.

That said, there's also nothing wrong with the self-powered version you started with, with the correct resistor values on VBUS.

However, I need to ask you to double-check the Tx and Rx connections between the two chips.  Those need to be connected in a crossover configuration - the Tx line coming out of the CP should be connected to the Atmega's Rx pin, and vice versa.  From your schematic, it looks like you have Tx connected to Tx, and Rx to Rx, and that won't work.  But that could depend on your labeling conventions, so I'm just asking you to make sure they are actually crossed over.

As for ground, you really need to get the opinion of some of the pros in here.  I think you would need to assume that the ground of USB is ultimately referenced to earth.  If the Atmega circuit, including the 5V supply, is floating, then I think you should be able to connect the two grounds.  But if it is earth referenced too, then you need expert advice an that.  I would do something simple like seeing if my voltmeter shows any potential between the two grounds when there are no connections between the two circuits, but that may not be a valid test.  You need someone with formal training to answer this, and that's not me.

 
The following users thanked this post: anishkgt

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC
« Reply #16 on: January 16, 2018, 08:36:55 pm »
I've connected the USBv+ to the Vbus on the CP and checked the voltage at VDD i can see a 3.2v still the laptop does not detect with board when connected.  What am i doing wrong ?

Quote
However, I need to ask you to double-check the Tx and Rx connections between the two chips.  Those need to be connected in a crossover configuration - the Tx line coming out of the CP should be connected to the Atmega's Rx pin, and vice versa.  From your schematic, it looks like you have Tx connected to Tx, and Rx to Rx, and that won't work.  But that could depend on your labeling conventions, so I'm just asking you to make sure they are actually crossed over.
Thanks for pointing that out to me. I did think of it at design but forgot to correct before fabricating the board. Still learning from my mistakes. |O
Quote
That said, there's also nothing wrong with the self-powered version you started with, with the correct resistor values on VBUS.
That would just waste 195uA as suggested and more over i went with that design earlier because i did not get the whole thing about "same GND and same +5v voltage from different source". This post has really helped me understand it better.
Quote
As for ground.....
Yes the PCB is floating but i wish to have the USB side of the PCB in its own GND plane. Was hoping somebody could really advise me on that, would appreciate it.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #17 on: January 16, 2018, 09:56:17 pm »
I've connected the USBv+ to the Vbus on the CP and checked the voltage at VDD i can see a 3.2v still the laptop does not detect with board when connected.  What am i doing wrong ?


If you have V+ also connected to VREGIN, and D+ and D- wired correctly, then I think it should work.  I don't know what to suggest.
 
The following users thanked this post: anishkgt

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC
« Reply #18 on: January 16, 2018, 10:31:28 pm »
Thanks all seems to be working now after i had connected Vregin with Vbus+.

Now i need to enable the Tx and Rx feature on the IC and am not sure how it can be done on Simplicity Studio. I've downloaded and opened Xpress configurator, not sure how to go forward.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #19 on: January 16, 2018, 11:36:39 pm »
Thanks all seems to be working now after i had connected Vregin with Vbus+.

Now i need to enable the Tx and Rx feature on the IC and am not sure how it can be done on Simplicity Studio. I've downloaded and opened Xpress configurator, not sure how to go forward.

If you mean enable Tx and Rx on the CP2102N, I think all of that just works by default.  Assuming you have the regular VCP driver installed on your computer, you should be able to bring up the CP's COM port in any terminal program, send data, and watch the LED blink.  Or you can connect Rx to Tx, and loop back what you send.

It would be unusual if you needed to configure the CP in any way unless you are doing something strange.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: CP2102N UART not detecting on PC
« Reply #20 on: January 16, 2018, 11:57:16 pm »
Did you install the Driver ?
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC
« Reply #21 on: January 17, 2018, 12:30:17 am »
Quote
It would be unusual if you needed to configure the CP in any way unless you are doing something strange.

This particular models requires the Rx and Tx (GPIO pin 0 and 1) to be enabled to act as Tx and Rx. Got that also figured  out, i had placed the LEDs in reverse, changed it and all looks good. I am not sure if that feature is enabled by default. I did set it though. So am not sure if it was the LED that i had placed or the enabling the PIN.
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #22 on: January 17, 2018, 12:52:50 am »
He means TXT and RXT, not the data lines.
 
The following users thanked this post: anishkgt

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #23 on: January 17, 2018, 02:19:33 am »
Quote
It would be unusual if you needed to configure the CP in any way unless you are doing something strange.

This particular models requires the Rx and Tx (GPIO pin 0 and 1) to be enabled to act as Tx and Rx. Got that also figured  out, i had placed the LEDs in reverse, changed it and all looks good. I am not sure if that feature is enabled by default. I did set it though. So am not sure if it was the LED that i had placed or the enabling the PIN.

Well congratulations on getting this part of your project working, anishkgt.  It's nice when things work.
 
The following users thanked this post: anishkgt

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #24 on: January 17, 2018, 06:26:37 am »
Well thank you couldn't have done without a little help from the community. :-+

Though Vregin is shorted to Vbus, the datasheet recommends uning the voltage divider for optimum operation. Now with the voltage divider, the voltage at Vregin is 3.1v so would it be ok to short it to VDD as it has the same voltage ?
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #25 on: January 17, 2018, 01:28:05 pm »
Just checked it out and i see that VDD goes to 4.2v which is the max mentioned in the datasheet. So i guess i will have to decide up voltage divider or just connect the Vregin to VBus.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #26 on: January 17, 2018, 03:27:16 pm »
VREGIN is the 5V input to the internal voltage regulator, and Vdd is the output - regulated to 3.3V.  I don't understand what voltage divider you're describing, or why you would want to connect them together.

VREGIN should be connected to the USB 5V V+.  VBUS is the sense input that tells the chip that USB is connected.  If you are powering the CP from USB, you should just connect VBUS to USB V+ as well with no divider.  Vdd is what the chip uses internally for all its operations, and it could be used to power the MCU, but you aren't doing that.  So I think Vdd would only be connected to your LEDs.

Connecting 5V to Vdd would change all the CP internal operations and I/O to 5V.  Monkeh says you can't do that, and there's nothing in the data sheet to suggest it is permissible.


 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #27 on: January 17, 2018, 03:50:16 pm »
When in doubt, consult the datasheet.  Page 7, electrical specifications say 3.6V max for Vdd. kind of nails that coffin...
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #28 on: January 17, 2018, 04:07:28 pm »
Yea I feel so silly now. So the voltage divider for the Vbus is not necessary then though the data sheets says and what about the gnd plane ? Would it be ok to do as mentioned post 14


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #29 on: January 17, 2018, 09:28:47 pm »
Ok, I think I understand what you were asking about connecting Vbus to Vdd.

First, I believe you have decided to go to a bus powered arrangement as shown in Figure 2.5 in the datasheet.  The "Note" about the voltage divider below Figure 2.5 does not apply to Figure 2.5, but rather to the self powered circuit shown in Figure 2.6 on the next page.  So the datasheet does not suggest that you use the divider in bus powered mode.  It's confusing, but the sentence just above the Note refers to "the figure below".

That said, I understand the idea of just connecting Vbus to Vdd.  If Vdd is 3.3V, that should be high enough for Vbus.  But the problem may be that the 3.3V regulator is not turned on until Vbus goes high, so you would get unpredictable results.  And if you actually get 4.2V on Vdd when you connect it that way, there's clearly something wrong.  So the bottom line is to just connect it like Figure 2.5 if you are going bus powered.

Also, you won't need diode D6.  So you would be dropping that diode and the two resistors by switching from self-powered to bus powered.

I wish I could give you advice on the ground situation, but just don't feel competent to do that.

 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #30 on: January 19, 2018, 07:13:03 am »
I'm looking at incorporating the CP2102N in a project so I'm coming up to speed on this.
There is a mini eval kit (CP2102N-miniEK) that I've ordered - it's all of $8.  Here's the schematic https://www.silabs.com/documents/public/schematic-files/CP2102N-MiniEK-schematic.pdf It shows a bus powered version.

One thing that they have done is not directly connect the USB shield to the usb gnd pin and use a 1M resistor and a 100 pF cap between them. Not sure I get the reason for that.  Have not seen that in other USB schematics I've looked at.

Another oddity is they have a 0.05 Ohm resistor in the USB V+ line between the USB connector pin 1 and the VREGIN pin of the CP2102N. I don't think it's a sense resistor and don't see it limiting any current. It's possible that it could be used for monitoring USB current but there are no testpoints or breakouts for it.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #31 on: January 19, 2018, 02:55:49 pm »
I'm looking at incorporating the CP2102N in a project so I'm coming up to speed on this.
There is a mini eval kit (CP2102N-miniEK) that I've ordered - it's all of $8.  Here's the schematic https://www.silabs.com/documents/public/schematic-files/CP2102N-MiniEK-schematic.pdf It shows a bus powered version.

One thing that they have done is not directly connect the USB shield to the usb gnd pin and use a 1M resistor and a 100 pF cap between them. Not sure I get the reason for that.  Have not seen that in other USB schematics I've looked at.

Another oddity is they have a 0.05 Ohm resistor in the USB V+ line between the USB connector pin 1 and the VREGIN pin of the CP2102N. I don't think it's a sense resistor and don't see it limiting any current. It's possible that it could be used for monitoring USB current but there are no testpoints or breakouts for it.

Did you get that from Silabs or somewhere else?

I have not seen that ground treatment either.  I checked several CP2102 modules I have, and all of them have the shield and the gnd pin directly connected.  I don't know what the USB spec says about the shield and gnd.

One possibility for that strange V+ resistor - one module has something in that position marked "T05".  I had concluded that it's a resettable fuse.  Not sure where I got that, but that could be what they're providing for.  But it measures more like .5 ohm, not .05.

 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #32 on: January 19, 2018, 09:42:47 pm »
Ordered it from Mouser but you can buy from SiLabs, too.

The schematic shows that device as a resistor (R5, on the schematic) and calls out the value as 0.05R. It seems kind of useless to me. However, I like the idea of being able to monitor current pulled by the system and that is a pretty convenient spot when bus powered.

For what it's worth, my layout just ties shield to gnd. Well see when I get the board.  I'm still fussing the design. Biggest question is whether to terminate various unused pins.  Generally it's a good idea but the config software has some interactions that I don't understand.  The miniEK leaves RI/CLK, DCD, DTR, DSR, GPIO.4, GPIO.5 and GPIO.6 unconnected. I'll assume those are fine to leave dangling. It takes RTS, GPIO.3, GPIO.4, chren, chr1, chr0, RXT, TXT, TXD and Suspend to the header. It's not clear what they expect to have done with them. (Some are pretty obvious, though). Once I get the miniEK I'll be able to figure it out.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #33 on: January 20, 2018, 01:47:08 am »
Here's what AN976 says about some of those pins:

The CP2102N-A01-GQFN28 is fully pin compatible with the CP2102/9. No hardware changes will be required when transitioning a CP2102/9 design to the CP2102N.

The CP2102N does, however, have extra functionality on pins 13 through 22. A new design may want to take advantage of these extra pins, but they can be safely left unconnected.

 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #34 on: January 20, 2018, 07:02:57 am »
Nice catch, I scanned through that but clearly should have slowed down.  Thanks.
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC
« Reply #35 on: January 21, 2018, 01:06:39 am »

Quote
One question - is your 328 a 5V part?  The CP2102N TXD, etc., will all be at 3.3V.  It might work anyway, but it would be better if they matched.

It will work fine. There's no need to match voltages.
I was curious about this and looked it up. The 328, indeed, has a Vih of Vcc * 0.6.  Unfortunately newer AVR8s (the ATTiny 162x) have it as Vcc * 0.7 which means 3.5V so one needs translation on outputs from the CP2102N to a newer AVR8 running at 5V.  Sigh. Not the end of the world but kind of a pita, I'll just use a 1 gate HCT buffer.
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: CP2102N UART not detecting on PC
« Reply #36 on: January 21, 2018, 01:19:35 am »

Quote
One question - is your 328 a 5V part?  The CP2102N TXD, etc., will all be at 3.3V.  It might work anyway, but it would be better if they matched.

It will work fine. There's no need to match voltages.
I was curious about this and looked it up. The 328, indeed, has a Vih of Vcc * 0.6.  Unfortunately newer AVR8s (the ATTiny 162x) have it as Vcc * 0.7 which means 3.5V so one needs translation on outputs from the CP2102N to a newer AVR8 running at 5V.  Sigh. Not the end of the world but kind of a pita, I'll just use a 1 gate HCT buffer.

That's unusual. Bare in mind, however, that's the guaranteed point - you may well find the majority of parts will be quite content with significantly less.

You could also just run the AVR at 3.3V and stop worrying - or are they still incapable of max clock speeds at standard voltages from this century?
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #37 on: January 21, 2018, 05:28:51 am »
Yeah, my latest ATTiny 1617 design runs at 3.3V and up translates to drive a 5V only device. But that's because it uses other periphs that run at 3.3V only.

The AVR8 may well accept 3.3V input as a high but I'd much prefer to run my parts within spec.

by the way, I typo'd the part number in the previous post - it's an ATTiny 1617.
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #38 on: January 21, 2018, 05:39:22 am »
Man, it seems like it's raining cp2102Ns these days.  Here's an interesting article that may or may not have some bearing on this topic: https://www.allaboutcircuits.com/technical-articles/project-troubleshooting-solutions-from-a-problem-magnet/
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #39 on: January 21, 2018, 03:16:54 pm »
Phil, there's another possible solution to the matching problem.  If you aren't using the Vdd output to power other parts of your circuit, you could run the CP2102N at a slightly higher voltage by driving the Vdd pin at something above 3.3V.  I believe the datasheet lets you go up to 3.6V, which might be enough.

I had previously raised the possibility of driving Vdd at 5V from USB V+, but Monkeh says you can't do that.  However, there is a large batch of CP2102 (not N) adapter modules out there, and still being sold by Banggood, operating at 4.3V because of a routing error on the module board, and they seem to work fine connected to 5V Arduinos.  So if not 5V, perhaps going through a diode from 5V would work.  I wonder if Silabs would bless doing that.  Probably not.

And at the other end, you might see how low you could power the AVR8 and still be within spec.

And finally, I believe the FTDI chip and perhaps the CH430 can be run at 5V.  So perhaps the CP isn't the best choice for you.

 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #40 on: January 21, 2018, 05:01:34 pm »
One thing is for sure, there is no perfect solution out there.

I have the ch430g and my first attempt ended with it not oscillating. I've got several other caps and crystals to try but a crystal-less solution is attractive to me. I'll keep trying but I want a more sure-fire solution. The data sheet leaves a lot to guess-work/experimentation. And when you add up the total cost, the SiLabs part isn't too bad.

The FTDI chips are way too expensive - when it costs more than the rest of the parts combined, I draw the line.
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #41 on: January 21, 2018, 05:16:36 pm »
There are quite a few options out there. I've been meaning to try out a Holtek part, the HT42B534 - can operate at 5V or lower, includes a built in LDO for 3.3V, internal oscillator.. No external parts explicitly required. Even comes in an 8-pin package. Not 5V tolerant when running the I/Os at 3.3V, though.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #42 on: January 21, 2018, 05:35:25 pm »
Someone found a new CH340 version on AliExpress that doesn't require a crystal.  If that runs at 5V, it might be a good choice, assuming the driver works for you.

I read the CP2102N datasheet wrong.  3.6V is the maxiumum OUTPUT on Vdd when the internal regulator is used.  But the Absolute Maximum voltage on Vdd when it is driven from outside is 4.2V, which is the same as the non-N part.  That's probably why the bad modules worked ok at 4.3V.

Tell me again why you can't run the AVR8 at 3.3V?  Is it because you need 16 Mhz, or what?
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #43 on: January 21, 2018, 09:19:59 pm »
Thinking about translating the CP's 3.3V outputs to 5V for the AVR8 with a buffer, I'm reminded that there's another translation that may need to be done in the other direction.  The AVR8's TX line will be supplying 5V to the CP's RX pin, which is expecting 3.3V.  That datasheet shows 5.8V as the maximum voltage on that pin, so in theory it should work, but I wonder if there isn't a protection diode going from RX to Vdd.  If there is, then applying 5V would bring Vdd up to 4.3V.  Well, it was just a thought, but it just seems to me that having the two parts match is a good thing - either a 5V USB adapter, or a 3.3V processor.

 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #44 on: January 21, 2018, 09:29:33 pm »
No, there's no simple diode there. That's the whole point of having 5V tolerant I/O.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #45 on: January 22, 2018, 12:03:33 am »
No, there's no simple diode there. That's the whole point of having 5V tolerant I/O.

I can't speak for the CP2102N, but I just tested it on the CP2102, and when I apply 5V to RXD, Vdd goes to 4.27V.  So on that chip, there IS a diode there. Apparently it's not 5V tolerant, other than in the sense of not destroying the chip.  Maybe the N is different, but I doubt it.

But you know, there are lots and lots of circuits in the world in which the CP2102 at 3.3V is connected directly to 5V processors, and they seem to work fine.  So I'm going to drop back to my suggestion of just driving Vdd from the USB 5V line, through a diode to drop it to about 4.3V.  I don't think that causes problems at either end.

In other news, it appears there are three new versions of the CH340G, none of which require crystals.  They are the B, C and E.  My memory is that the CHs run at either 3.3V or 5V.  I just don't know where you would find an official source.

The Holtek part you mentioned could be interesting.

 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #46 on: January 22, 2018, 12:57:41 am »
That is.. odd, and indeed I've just verified that on a CP2104 and CP2102N. This should not be the case - other devices may be using the output of the internal (or an external) regulator, and this flat out violates their own ratings. Vdd should not be getting driven high by the I/O pins like this.

E: Nope, sorry, misread my own silkscreen. Driving TX to 5V resulted in this behaviour - RX, however, showed no such thing. Vdd remained at 3.45V while RX was driven to 5V. You were powering it before trying this, right?

Also in the process I blew up an FT231 adapter - I should really check on turn-on transients before using power supplies for this sort of thing - think the next spin will have some extra clamping.
« Last Edit: January 22, 2018, 01:29:48 am by Monkeh »
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #47 on: January 22, 2018, 02:24:06 am »
Someone found a new CH340 version on AliExpress that doesn't require a crystal.  If that runs at 5V, it might be a good choice, assuming the driver works for you.

I read the CP2102N datasheet wrong.  3.6V is the maxiumum OUTPUT on Vdd when the internal regulator is used.  But the Absolute Maximum voltage on Vdd when it is driven from outside is 4.2V, which is the same as the non-N part.  That's probably why the bad modules worked ok at 4.3V.

Tell me again why you can't run the AVR8 at 3.3V?  Is it because you need 16 Mhz, or what?

The problem I have with the CH430 is the terrible data sheet and complete lack of design support. I'll fuss at it some more to try and get it working but I need a working, not-FTDI solution.

It's not that I can't run at 3.3V but it involves tradeoffs.  I'm not looking at this for one specific project (I have a never ending pipeline). For my current project, I have several 3.3V parts and a 5V part. I'm running the tiny at 10 MHZ/3.3V and translating it's output up to 5V. I've got several in the works where I want to run various AVRs at 20 MHz so the mpus need to be at 5V.  I've got a bunch of HCT buffers (74AHCT1G125SE-7 $0.07 Q100) on order for voltage translation.  Dirt cheap, tiny, fast enough and easy to use so it's not then end of the world.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #48 on: January 22, 2018, 03:20:52 am »
That is.. odd, and indeed I've just verified that on a CP2104 and CP2102N. This should not be the case - other devices may be using the output of the internal (or an external) regulator, and this flat out violates their own ratings. Vdd should not be getting driven high by the I/O pins like this.

E: Nope, sorry, misread my own silkscreen. Driving TX to 5V resulted in this behaviour - RX, however, showed no such thing. Vdd remained at 3.45V while RX was driven to 5V. You were powering it before trying this, right?


Yes, I had the CP2102 powered up from the USB bus, and voltage read 3.32V on Vdd.  Then I connected 5V to RXD, and the voltage on Vdd changed to 4.27V.  However, I'm working with two modules, not just the chips.  Both modules take Vdd to 4.27V when 5V is applied to RXD.  However, all the ouput pins of one module take Vdd to 4.6V, and the other takes Vdd to 4.7V, when 5V is applied to each output pin (TXD, DTR and RTS).

However, these modules have LEDs on RXD and TXD.  But they stay off during this test, only lighting up if those lines go low.  So if they have any effect on this test, current would have to flow backward through the LEDs to Vdd.

Maybe I'm not thinking this through properly, but I don't see what effect the LEDs would have unless they leak.  At the same time, I can't guarantee that these chips are genuine.  If they aren't, that could explain the difference.  Or it could be that the CP2102 didn't behave properly, but the N does.

Anyway, if you aren't getting any problem on RXD on the "N" part, then I think that settles the issue for Phil, and no translation would be needed for RXD.

 
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: CP2102N UART not detecting on PC [SOLVED]
« Reply #49 on: January 22, 2018, 03:34:12 am »
Phil, it still sounds like you need a USB adapter that will operate at either 3.3V or 5V to avoid the need for the translation.  The only non-FTDI part that I think does that would be the new CH340 parts.  Actually, the Holtek part appears to do that, but it looks like it uses a differnent kind of software on the PC to drive it - not a virtual COM port like the others.  But depending on what you're doing, that might work fine - as I understand it, you don't actually need a driver for the Holtek.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf