go_away

Author Topic: CP2102 5V power, USB power, 3.3V power?  (Read 7421 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
CP2102 5V power, USB power, 3.3V power?
« on: January 04, 2008, 05:50:37 PM »
This is NOT related to my problem here:
http://www.societyofrobots.com/robotforum/index.php?topic=2767.0
That problem was using the CP2102 breakout board from sparkfun. My below problem is based on a custom board I am working on using the same chip.

I need my CP2102 chip to give me 3.3V volts. When I hook it up to USB, it works and gives me the correct voltage. But when I remove USB, the voltage dies. I now realize it is because I wired it incorrectly.

Looking at the CP2102 datasheet I am confused which schematic to use (page 14 and 15). I used configuration 1, and I know configuration 3 won't work for me.

I have a ~5.3V source on my board, so if I do configuration 2, will this give me ~3.3V without the USB cable attached? The datasheet doesn't mention anything about configuration 2 but I don't see any other reason it would exist . . .

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #1 on: January 04, 2008, 07:28:48 PM »
if pin 8 (VBUS) is low the whole chip powers down, 3,2V regulator included.
it would usually be the desired behavior to power down the USB device if it is not plugged in i guess.

if you want to keep the chip powered on, tie pin8 to your 5V source.

the only problem you might encounter with this is persuading the chip to reset when you plug it back in to a USB port....
don't know if that will be a problem or not.


dunk.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #2 on: January 08, 2008, 03:41:01 PM »
I emailed them, and below is what they said. Basically I was right, I can do config 2. And the USB detection is done on the VBUS pin, so I don't have to worry about that.

Quote
It sounds like you have configured the CP2102 in a "Bus-Powered" configuration. This will power the CP2102 only when the USB is connected.

To use the CP2102 on-chip regulator to get 3.3V when USB is not connected, you should connect the CP2102 in the "Self-Powered" configuration shown in Fig 8 of the CP2102 datasheet. In this config, the CP2102 will continue to generate 3.3V even when USB is not connected using your on-board 5.3V source (connected to REGIN pin). You don't need to generate any special reset on connection to USB because the CP2102 can detect USB connection using the VBUS pin. Note that the on-chip regulator can supply a maximum of 100 mA current at 3.3V. This includes the ~27mA current needed by the CP2102 itself. So, your board can only draw ~73mA or less from the CP2102 to stay within specifications. If more current is needed by your board, an external voltage regulator should be used instead.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #3 on: February 04, 2008, 04:29:51 PM »
I now have it set up in configuration 2 as mentioned earlier:
VBUS USB to VBUS pin
5V regulated to REGIN pin
3V output on Vdd (not used)

But I am getting a weird problem . . .

Just plugging in USB only, it gives me 4.95V on the VBUS pin. The other pins are all still low. This is fine, and expected.

Ok so now I only plug in 5V but no VBUS. It outputs 3.36V (supposed to be 3V?), the REGIN pin is still 5.01V, and the VBUS line is 0V . . . this is all correct.

Now plugging in the 5V regulated and USB simultaneously . . . the chip outputs 3.36V, the REGIN pin is 5.01V (also correct), but then the VBUS line magically jumps to 8.3V! Its as if it is adding VBUS + Vdd . . .

Thinking maybe I had a bad chip, I swapped it out for a another one, yet still the same exact problem. Since its a QFN package, its hard to tell if I soldered it properly, but under my 10x microscope it looks ok to me.

Also to note, I have tons of caps on my REGIN line, no caps on the VBUS line, and one .1uF cap on my unused Vdd line. Attached is my schematic.

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #4 on: February 04, 2008, 05:09:47 PM »
For what it's worth, I attached the schematic of our old CP2102 board for the XBee radio.  We powered the radio off the 3.3V output from the CP2102, and the board worked great.  Now we're using the same board to program the Lantronix Matchport WLAN module.
Surveyor Corporation
  www.surveyor.com

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #5 on: February 04, 2008, 05:20:55 PM »
hgordon . . . your schematic is for configuration 1. I originally did that config earlier in this topic, but the problem I had is that the 3.3V output voltage stops working when you unplug USB.

Basically what I am doing is what you have, but the REGIN pin is instead attached to my regulated 5V line. Oh and I used the recommended .1uF instead of .01uF cap that you used (why did you use the lower cap?).

I don't understand how I could get greater than 8V when my highest voltage is 5V DC . . . ???

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #6 on: February 04, 2008, 07:35:44 PM »
Gotcha.  Are you using a 9V source for your 5V regulator ?  If you measure the output of a linear regulator that has no load, you may see a higher voltage.  I don't understand why it's coming out on the VBus side, but who knows what is happening inside the CP2102 power management.  In any case, as long as you have the right output voltage, maybe this isn't a real issue.
Surveyor Corporation
  www.surveyor.com

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #7 on: February 05, 2008, 08:15:34 AM »
Nah, I'm using a 6V battery for the LDO regulator. My computer just isn't recognizing the setup . . . but it works fine on my other boards using config 1.

I emailed the manufacturer again.

Maybe I should do some surgery on an older config 1 board to make it config 2 . . .

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #8 on: February 05, 2008, 12:02:05 PM »
Oh and I used the recommended .1uF instead of .01uF cap that you used (why did you use the lower cap?).

We actually use 0.1uF and 10uF on the board, but never got around to updating the schematic. 
Surveyor Corporation
  www.surveyor.com

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #9 on: February 05, 2008, 01:10:08 PM »
I just checked the voltage between USB ground and USB VBUS directly when everything is plugged in . . . gave me 8.1V . . . makes no sense!

My surgery idea on my old board didn't work . . . its impossible to solder to the QFN, and there are no traces coming out of the REGIN pin to solder to . . . I'll have to wait for now till I get an email back . . .

I'll try and get more boards from the manufacturer in China (who oddly only sent me one), maybe there is something internally wrong with it. Will have to wait till the new years is over, and they recover from the snow storm . . . not till the 14th at least.

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #10 on: February 05, 2008, 01:33:03 PM »
What kind of CP2102 board do you need ?  I have a bunch of these -

    http://www.surveyor.com/images/matchport-config4.jpg

without connectors (I'm waiting for a shipment of the USB connectors)

Surveyor Corporation
  www.surveyor.com

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #11 on: February 05, 2008, 02:29:53 PM »
I figured out whats wrong (I think)! Although not sure how to fix it . . .

Rereading the datasheet I noticed something I didn't see before:
Quote
The USB max power and power attributes descriptor must match the device power usage and configuration. See application note “AN144: CP210x Customization Guide” for information on how to customize USB descriptors for the CP2102.


So then looking up the AN144 application note, on page two it shows the configuration program. Since I am using "Configuration 2: USB Self-Powered", I need to check the box that says 'Self-powered' (I think).

However, my CP2102 (in this configuration) doesn't respond when I hook it up. My older board in config 1 works fine with the program . . .

ideas?

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #12 on: February 05, 2008, 02:59:09 PM »
You moved well beyond what I know about the chip, so hopefully you can get some technical support from the manufacturer.
Surveyor Corporation
  www.surveyor.com

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #13 on: February 06, 2008, 11:20:15 AM »
Thought I'd give an update on my progress (problems).

I figured out a way, with my battery unplugged but USB plugged in, to short two vias that effectively makes it a config 1 setup.

When I did this, the application software worked, and I reprogrammed the CP2102 to be self powered successfully.

However my voltages are still doing crazy stuff, now giving me negative voltages, and data still isn't being transmitted. I am still trying out a few ideas of have to fix this and I'll report later if they fail, just thought I'd update you guys so you won't bother figuring out the previous problems . . .

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #14 on: February 06, 2008, 04:34:03 PM »
It works! :)

The negative voltages were from grounds being uncommon - caused by an intermittent badly soldered SMD joint . . . oops! This might also explain the 8V I saw earlier . . .

Apparently my Tx trace from my microcontroller was also damaged when I removed/replaced it. It was only noticeable under microscope . . . Added some solder over the damage, then it worked.

Debugging is soooo much harder when multiple problems exist . . .

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: CP2102 5V power, USB power, 3.3V power?
« Reply #15 on: February 07, 2008, 08:39:31 AM »
The manufacturer just got back to me. I haven't investigated it, but it appears that application reprogramming isn't required:

Quote
I apologize for the delayed response. I'm glad you were able to find the source of the problem and fix it. With the default MaxPower values, the CP2102 should work in self-powered mode even if the you have not reprogrammed the device to be self-powered using the AN144 software. The "self-powered" check box only alters a value in the USB descriptor that lets the host know that the CP2102 won't need any power from the host. Please let me know if you have any other questions.

 


Get Your Ad Here