<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>USB Power Archives - Digital Me</title>
	<atom:link href="https://ba0sh1.com/tag/usb-power/feed/" rel="self" type="application/rss+xml" />
	<link>https://ba0sh1.com/tag/usb-power/</link>
	<description>Electronics, Computers at leisure time</description>
	<lastBuildDate>Fri, 08 Nov 2013 15:28:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
	<item>
		<title>FT230X charger detection investigation</title>
		<link>https://ba0sh1.com/2013/11/08/ft230x-charger-detection-investigation/</link>
					<comments>https://ba0sh1.com/2013/11/08/ft230x-charger-detection-investigation/#comments</comments>
		
		<dc:creator><![CDATA[Baoshi]]></dc:creator>
		<pubDate>Fri, 08 Nov 2013 15:28:41 +0000</pubDate>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Charger]]></category>
		<category><![CDATA[FT230X]]></category>
		<category><![CDATA[FT230XS]]></category>
		<category><![CDATA[USB Power]]></category>
		<guid isPermaLink="false">https://www.ba0sh1.com/?p=786</guid>

					<description><![CDATA[<p>I bought some FT230X (FT230XS) USB-USART bridge chip recently for a new design.  FT230X is not only cheaper than the traditional FT232RL, but also offers a new fancy &#8220;USB charger detection&#8221; function....</p>
<p>The post <a rel="nofollow" href="https://ba0sh1.com/2013/11/08/ft230x-charger-detection-investigation/">FT230X charger detection investigation</a> appeared first on <a rel="nofollow" href="https://ba0sh1.com">Digital Me</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I bought some FT230X (FT230XS) USB-USART bridge chip recently for a new design.  FT230X is not only cheaper than the traditional FT232RL, but also offers a new fancy &#8220;USB charger detection&#8221; function. This interests me because I&#8217;m quickly running out of desk space and power socket. I wish the new device to be solely powered by USB and/or battery.</p>
<p><span id="more-786"></span>Designing a proper USB powered device is no simple task, this is because:</p>
<ol>
<li>If the device needs more the 100mA current, it is only allowed to draw that amount after requesting from host during USB enumeration. Some USB hosts, for example the down stream port on a bus-powered USB hub, is only able to provide maximum 100mA. So the device must be intelligent enough to differentiate the host types.</li>
<li>USB sleep mode current limitation must be considered as well.</li>
<li>I also wish the device to operate autonomously without a PC. That means it must accept power from &#8220;dummy&#8221; USB hosts such as a USB charger.</li>
</ol>
<p>Clearly point (3) conflicts with points (1) and (2) because USB charger cannot be enumerated and does not have sleep mode. And this is why I&#8217;m interested in FT230XS&#8217;s &#8220;USB charger detection&#8221; function.</p>
<p>A thorough test is still needed. According to the datasheet, FT230XS supports detection of battery charger which conforms to the USB <a title="USB Battery Charging Specification" href="http://www.usb.org/developers/devclass_docs/BCv1.2_011912.zip" target="_blank" rel="noopener">BC1.2</a> specification. AFAIK many USB chargers, notably those made by Apple, are not BC1.2 compatible. Whether FT230XS can detect those chargers is not specified in the datasheet.</p>
<p>A quick background about USB power supply and USB charging: the original USB specification limits the USB downstream current to 500mA (after enumeration).  However 500mA is too low to charge battery powered devices such as a smartphone. <a title="USB Battery Charging Specification" href="http://www.usb.org/developers/devclass_docs/BCv1.2_011912.zip" target="_blank" rel="noopener">BC1.2</a> was then specified, which introduced &#8220;Charging Downstream Port (CDP)&#8221; and &#8220;Decicated Charging Port (DCP)&#8221;. A DCP internally shorts &#8220;D+&#8221; and &#8220;D-&#8221; together. When DCP is detected, the device may draw as much as 1.8A from the port. Identification for CDP is much complicated and outside the scope of my interest  (because I have no CDP compliant host), more readings can be found <a title="The Basics of USB Battery Charging: A Survival Guide" href="http://www.maximintegrated.com/app-notes/index.mvp/id/4803" target="_blank" rel="noopener">here</a>.</p>
<p>While looks simple on paper, the actual USB charging situation is much more complicated. Reason being that USB charging specification came too late and vendors have been inventing their own charging protocols. Notably:</p>
<ol>
<li>Apple has been inventing USB charging protocol since iPod days (check out the hardwork <a title="iCharging" href="http://learn.adafruit.com/minty-boost/icharging" target="_blank" rel="noopener">here</a>). The charger&#8217;s capability is identified by the voltages on D+ and D- lines, as:
<ul>
<li>(D+,D-) = (2.0V, 2.0V) -&gt; 500mA (iPod charger)</li>
<li>(D+,D-) = (2.8V, 2.0V) -&gt; 1A (iPhone charger)</li>
<li>(D+,D-) = (2.0V, 2.8V) -&gt; 2A (iPad charger)</li>
</ul>
</li>
<li>Chinese standard <a title="Chinese USB Charging Standards" href="http://www.digikey.com/Web%20Export/Supplier%20Content/PI_596/PDF/PowerInt_ChinaUSB.pdf?redirected=1" target="_blank" rel="noopener">YD/T 1591-2006</a>. Which is basically the same as BC 1.2, shorting D+ and D-.</li>
<li>European smartphone charging standards says a 200Ω resister must be connected in-between D+ and D- to identify a charger.</li>
</ol>
<p>FT230XS is very easy to use. I made a simple testing board using a SSOP-16 breakout adaptor. The contact was was plucked from a USB header and glued to the breakout adaptor. Chip under test is FT230XS, Rev D, date code 1243.</p>
<figure id="attachment_795" aria-describedby="caption-attachment-795" style="width: 360px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/10/f0aba-ft230xs-breakout.png" target="_blank" rel="noopener"><img decoding="async" class=" wp-image-795 " alt="FT230XS breakout board" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/10/f0aba-ft230xs-breakout.png" width="360" height="359" srcset="https://ba0sh1.com/wp-content/uploads/2013/10/f0aba-ft230xs-breakout.png 600w, https://ba0sh1.com/wp-content/uploads/2013/10/f0aba-ft230xs-breakout-300x300.png 300w, https://ba0sh1.com/wp-content/uploads/2013/10/f0aba-ft230xs-breakout-150x150.png 150w" sizes="(max-width: 360px) 100vw, 360px" /></a><figcaption id="caption-attachment-795" class="wp-caption-text">FT230XS breakout board</figcaption></figure>
<p>I further mount the adaptor onto a breadboard and connect 3 LEDs onto the CBUS pins. The configuration of the colors are:</p>
<ul>
<li>Yellow &#8211; BCD#, should light up when charger is detected.</li>
<li>Red &#8211; PWEN#, indicates required power negotiated.</li>
<li>Green &#8211; SLEEP#, should light up when USB enters sleep mode (host suspend).</li>
</ul>
<figure id="attachment_796" aria-describedby="caption-attachment-796" style="width: 360px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/10/915af-ft230xs-breadboard.png" target="_blank" rel="noopener"><img decoding="async" loading="lazy" class=" wp-image-796 " alt="FT230XS on breadboard" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/10/915af-ft230xs-breadboard.png" width="360" height="270" srcset="https://ba0sh1.com/wp-content/uploads/2013/10/915af-ft230xs-breadboard.png 600w, https://ba0sh1.com/wp-content/uploads/2013/10/915af-ft230xs-breadboard-300x225.png 300w" sizes="(max-width: 360px) 100vw, 360px" /></a><figcaption id="caption-attachment-796" class="wp-caption-text">FT230XS on breadboard</figcaption></figure>
<p>The chip is programmed using official FT_Prog utility. Power required is set to 500mA. I would skip all the testing procedures and note down the results here:</p>
<p><strong>Testing with PC USB port</strong></p>
<p>Scenario 1. Connect to a PC USB port when PC is running: Green LED (SLEEP#) lit up then all LEDs turn off shortly. Windows start to find driver. Red LED (PWEN#) lit up when Windows starts to download driver from Windows Update. Red LED stays on after driver installed.</p>
<p>Scenario 2. While FT230XS still connected, put Windows into sleep mode: Red LED (PWEN#) off and Green LED (SLEEP#) lit up, indicating sleep mode.</p>
<p>Scenario 3. Resume windows: Green LED off, Red LED lit up, indicating power enable.</p>
<p>Scenario 4. Unplug FT230XS, put Windows into sleep mode and plug the FT230XS: Red LED off, Green LED lit up, indicating sleep mode.</p>
<p>Scenario 5. While FT230XS is still connected, shutdown PC: Green LED still on, indicating sleep mode.</p>
<p>Scenario 6. Unplug FT230xS, shutdown PC and plug FT230XS back: Green LED lit up, indicating sleep mode.</p>
<p><strong>Testing with PC USB through a self-powered USB hub:</strong></p>
<p>Same as previous results.</p>
<p><strong>Testing with PC USB through a bus-powered USB hub:</strong></p>
<p>Unfortunately all my USB hubs report themselves as self-powered even if they are not. I had to modify a hub into bus-powered. Bus-powered hub can be identified in Windows Device Manager as:</p>
<figure id="attachment_799" aria-describedby="caption-attachment-799" style="width: 254px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/10/9452d-usb-bus-powered-hub.png" target="_blank" rel="noopener"><img decoding="async" loading="lazy" class=" wp-image-799 " alt="USB bus-powered hub" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/10/9452d-usb-bus-powered-hub.png" width="254" height="281" srcset="https://ba0sh1.com/wp-content/uploads/2013/10/9452d-usb-bus-powered-hub.png 423w, https://ba0sh1.com/wp-content/uploads/2013/10/9452d-usb-bus-powered-hub-271x300.png 271w" sizes="(max-width: 254px) 100vw, 254px" /></a><figcaption id="caption-attachment-799" class="wp-caption-text">USB bus-powered hub</figcaption></figure>
<p>Scenario 1. Connect to bus-powered hub: Green LED (SLEEP#) lit up then all LEDs turn off shortly, Windows show the following message. All the LEDs stays off. It shows that Windows failed to configure the device because the USB port cannot supply enough current (500mA).</p>
<figure id="attachment_800" aria-describedby="caption-attachment-800" style="width: 544px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/10/e06cc-usb-power-exceed.png" target="_blank" rel="noopener"><img decoding="async" loading="lazy" class="size-full wp-image-800 " alt="USB power exceeded" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/10/e06cc-usb-power-exceed.png" width="544" height="214" srcset="https://ba0sh1.com/wp-content/uploads/2013/10/e06cc-usb-power-exceed.png 544w, https://ba0sh1.com/wp-content/uploads/2013/10/e06cc-usb-power-exceed-300x118.png 300w" sizes="(max-width: 544px) 100vw, 544px" /></a><figcaption id="caption-attachment-800" class="wp-caption-text">USB power exceeded</figcaption></figure>
<p>Scenario 2. While FT230XS still connected, put Windows into sleep mode: Green LED (SLEEP#) lit up, indicating sleep mode.</p>
<p>Scenario 3. Resume windows: All LEDs turn off.</p>
<p>Scenario 4. Unplug FT230XS, put Windows into sleep mode and plug the FT230XS: Green LED lit up, indicating sleep mode.</p>
<p>Scenario 5. While FT230XS still connected, shutdown PC: Green LED stays up, indicating sleep mode.</p>
<p>Scenario 6. Unplug FT230xS, shutdown PC and plug FT230XS back: Green LED lit up, indicating sleep mode.</p>
<p><strong>Test with USB chargers</strong></p>
<p>I tested 4 different chargers, as shown in the picture</p>
<figure id="attachment_817" aria-describedby="caption-attachment-817" style="width: 378px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/11/13687-usb-chargers.jpg" target="_blank" rel="noopener"><img decoding="async" loading="lazy" class=" wp-image-817  " alt="USB chargers under test" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/11/13687-usb-chargers.jpg" width="378" height="251" srcset="https://ba0sh1.com/wp-content/uploads/2013/11/13687-usb-chargers.jpg 630w, https://ba0sh1.com/wp-content/uploads/2013/11/13687-usb-chargers-300x199.jpg 300w" sizes="(max-width: 378px) 100vw, 378px" /></a><figcaption id="caption-attachment-817" class="wp-caption-text">USB chargers under test</figcaption></figure>
<p>Scenario A, plug FT230XS into a USB power adaptor from TPLink router (D+/D- shorted). Yellow LED (BCD#) lit up, indicating charger detected.</p>
<p>Scenario B, plug FT230XS into a USB charger for amazon Kindle (D+/D- shorted). Yellow LED (BCD#) lit up, indicating charger detected.</p>
<p>Scenario C, plug FT230XS into Apple iPhone charger (5V/1A), Yellow LED (BCD#) lit up, indicating charger detected.</p>
<p>Scenario D, plug FT230XS into Apple iPad charger (5V/2A), <span style="color:#ff0000;">Green LED (SLEEP#) lit up, indicating sleep.</span></p>
<p>Scenario E, since I do not have a Apple iPod charger (my iPod charger is Firewire charger), I connect FT230XS to 5V supply and supply D+/D- with 2V from voltage divider. <span style="color:#ff0000;">Green LED (SLEEP#) lit up, indicating sleep.</span></p>
<p>Scenario F, Connect FT230XS to 5V power supply (floating D+, D-),<span style="color:#ff0000;"> Green LED (SLEEP#) lit up, indicating sleep.</span></p>
<p>Summarize the findings, here is the result matrix: (On means asserted)</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="310"></td>
<td valign="top" width="102">
<p align="center">PWEN#</p>
</td>
<td valign="top" width="102">
<p align="center">SLEEP#</p>
</td>
<td valign="top" width="102">
<p align="center">BCD#</p>
</td>
</tr>
<tr>
<td valign="top" width="310">USB Host/Self-powered Hub (Power on)</td>
<td width="102">
<p align="center">On</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
<tr>
<td valign="top" width="310">USB Host/Self-powered Hub (Power off)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
<tr>
<td valign="top" width="310">USB Host/Self-powered Hub (Sleep)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
<tr>
<td valign="top" width="310">Bus-powered Hub (Power on)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
<tr>
<td valign="top" width="310">Bus-powered Hub (Power off)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
<tr>
<td valign="top" width="310">Bus-powered Hub (Sleep)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
<tr>
<td valign="top" width="310">USB Charger (Chinese/BC1.2)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
</tr>
<tr>
<td valign="top" width="310">Apple iPhone charger (1A. D+/D- = 2.8, 2.0V)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
</tr>
<tr>
<td valign="top" width="310">Apple iPad charger (2A. D+/D- = 2.0, 2.8V)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
<tr>
<td valign="top" width="310">Apple iPod charger (500mA, D+/D0 = 2.0, 2.0V)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
<tr>
<td valign="top" width="310">Dummy USB (D+/D- floating)</td>
<td width="102">
<p align="center">Off</p>
</td>
<td width="102">
<p align="center">On</p>
</td>
<td width="102">
<p align="center">Off</p>
</td>
</tr>
</tbody>
</table>
<div></div>
<div>I could use (PWEN or BCD) to turn on the device power, and use (SLEEP) to put device into low power mode. However, such logic is not working for iPad charger, iPod charger or dummy USB port, because FT230XS is not able to differentiate them from a bus-power USB hub.</div>
<div></div>
<div>So the verdict? I need more intelligence from FT230X  for proper USB power management <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /></div>
<div></div>
<div></div>
<p></p>
<p>The post <a rel="nofollow" href="https://ba0sh1.com/2013/11/08/ft230x-charger-detection-investigation/">FT230X charger detection investigation</a> appeared first on <a rel="nofollow" href="https://ba0sh1.com">Digital Me</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ba0sh1.com/2013/11/08/ft230x-charger-detection-investigation/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
	</channel>
</rss>
