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 “USB charger detection” function. This interests me because I’m quickly running out of desk space and power socket. I wish the new device to be solely powered by USB and/or battery.
Designing a proper USB powered device is no simple task, this is because:
- 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.
- USB sleep mode current limitation must be considered as well.
- I also wish the device to operate autonomously without a PC. That means it must accept power from “dummy” USB hosts such as a USB charger.
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’m interested in FT230XS’s “USB charger detection” function.
A thorough test is still needed. According to the datasheet, FT230XS supports detection of battery charger which conforms to the USB BC1.2 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.
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. BC1.2 was then specified, which introduced “Charging Downstream Port (CDP)” and “Decicated Charging Port (DCP)”. A DCP internally shorts “D+” and “D-” 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 here.
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:
- Apple has been inventing USB charging protocol since iPod days (check out the hardwork here). The charger’s capability is identified by the voltages on D+ and D- lines, as:
- (D+,D-) = (2.0V, 2.0V) -> 500mA (iPod charger)
- (D+,D-) = (2.8V, 2.0V) -> 1A (iPhone charger)
- (D+,D-) = (2.0V, 2.8V) -> 2A (iPad charger)
- Chinese standard YD/T 1591-2006. Which is basically the same as BC 1.2, shorting D+ and D-.
- European smartphone charging standards says a 200Ω resister must be connected in-between D+ and D- to identify a charger.
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.
I further mount the adaptor onto a breadboard and connect 3 LEDs onto the CBUS pins. The configuration of the colors are:
- Yellow – BCD#, should light up when charger is detected.
- Red – PWEN#, indicates required power negotiated.
- Green – SLEEP#, should light up when USB enters sleep mode (host suspend).
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:
Testing with PC USB port
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.
Scenario 2. While FT230XS still connected, put Windows into sleep mode: Red LED (PWEN#) off and Green LED (SLEEP#) lit up, indicating sleep mode.
Scenario 3. Resume windows: Green LED off, Red LED lit up, indicating power enable.
Scenario 4. Unplug FT230XS, put Windows into sleep mode and plug the FT230XS: Red LED off, Green LED lit up, indicating sleep mode.
Scenario 5. While FT230XS is still connected, shutdown PC: Green LED still on, indicating sleep mode.
Scenario 6. Unplug FT230xS, shutdown PC and plug FT230XS back: Green LED lit up, indicating sleep mode.
Testing with PC USB through a self-powered USB hub:
Same as previous results.
Testing with PC USB through a bus-powered USB hub:
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:
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).
Scenario 2. While FT230XS still connected, put Windows into sleep mode: Green LED (SLEEP#) lit up, indicating sleep mode.
Scenario 3. Resume windows: All LEDs turn off.
Scenario 4. Unplug FT230XS, put Windows into sleep mode and plug the FT230XS: Green LED lit up, indicating sleep mode.
Scenario 5. While FT230XS still connected, shutdown PC: Green LED stays up, indicating sleep mode.
Scenario 6. Unplug FT230xS, shutdown PC and plug FT230XS back: Green LED lit up, indicating sleep mode.
Test with USB chargers
I tested 4 different chargers, as shown in the picture
Scenario A, plug FT230XS into a USB power adaptor from TPLink router (D+/D- shorted). Yellow LED (BCD#) lit up, indicating charger detected.
Scenario B, plug FT230XS into a USB charger for amazon Kindle (D+/D- shorted). Yellow LED (BCD#) lit up, indicating charger detected.
Scenario C, plug FT230XS into Apple iPhone charger (5V/1A), Yellow LED (BCD#) lit up, indicating charger detected.
Scenario D, plug FT230XS into Apple iPad charger (5V/2A), Green LED (SLEEP#) lit up, indicating sleep.
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. Green LED (SLEEP#) lit up, indicating sleep.
Scenario F, Connect FT230XS to 5V power supply (floating D+, D-), Green LED (SLEEP#) lit up, indicating sleep.
Summarize the findings, here is the result matrix: (On means asserted)
PWEN# |
SLEEP# |
BCD# |
|
USB Host/Self-powered Hub (Power on) |
On |
Off |
Off |
USB Host/Self-powered Hub (Power off) |
Off |
On |
Off |
USB Host/Self-powered Hub (Sleep) |
Off |
On |
Off |
Bus-powered Hub (Power on) |
Off |
Off |
Off |
Bus-powered Hub (Power off) |
Off |
On |
Off |
Bus-powered Hub (Sleep) |
Off |
On |
Off |
USB Charger (Chinese/BC1.2) |
Off |
Off |
On |
Apple iPhone charger (1A. D+/D- = 2.8, 2.0V) |
Off |
Off |
On |
Apple iPad charger (2A. D+/D- = 2.0, 2.8V) |
Off |
On |
Off |
Apple iPod charger (500mA, D+/D0 = 2.0, 2.0V) |
Off |
On |
Off |
Dummy USB (D+/D- floating) |
Off |
On |
Off |
Hello Baoshi,
I can’t find any contact info in the site so forgive me for using the comment section. I’m Algen, I work with engineering website EEWeb.com and would love to do an exchange of website links (with your website: https://www.ba0sh1.com/) and feature you as a site of the day on EEWeb (you can see an example here http://www.eeweb.com/websites/multirotor-usa). Is this of interest to you?
Hope to hear from you soon.
Sincerely,
Algen Dela Cruz
EEweb.com
algen@eeweb.com
really attractive site with good content and updated topic,providing valuable information