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

0 Members and 1 Guest are viewing this topic.

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: 2006
  • 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: 2006
  • 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: 2006
  • 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: 2006
  • 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: 2006
  • 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: 2006
  • 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: 2006
  • 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: 2006
  • 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: 2006
  • 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: 2006
  • 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