Electronic – Bus and self powered device using FTDI FT230X

battery-chargingftdiusb

I'm trying to wire up my first device using an FTDI USB to Serial converter. FTDI recommends not mixing bus and self powered designs. But they also mention that it's possible in the documentation. My current design will be mostly self powered but will connect to a PC for data dumps and charging (200mA). It will be powered from a single cell LiPo and has some protection circuitry to prevent over discharging.

What I suspect might be a problem is USB suspend mode, which states that if no data is transferred for a set period the USB device should reduce power. Since most of my design operates from 3V, I want the FT230X to interface from this level as well. VBAT is guaranteed to always be 3.3V – 4.2V. Below is what I have so far, the idea was that configuring CBUS3 as a keep_awake that would prevent it from going to sleep (as I understand it), this would cause it to always be active though, even when self powered:

enter image description here

So my question is this, how do I implemented a bus and self powered device that can drain 200mA from the host for charging even when no data is being transferred?

Best Answer

First you should try to understand USB Suspend. It isn't quite so much "when no data is being transferred", but "when the data lines are idle for an extended period of time". In my experience, the bus only suspends when the PC is suspended. Otherwise, there's almost always some traffic flowing on the bus (e.g. Start of Frame markers etc). Now, there are other types of suspend, but they are generally optional.

So, like Passerby said, you really don't have to worry about not going into suspend mode. There's always 5V on VBus when the computer is suspended - otherwise, remote wake up would not be possible - and most host controllers don't really enforce the Suspend current restrictions. If they did enforce the current restrictions, someone's not-quite-good-enough device might work on one host controller but not another, and the consumer is likely to blame the computer/host controller for not working with a bad device, rather than blaming the manufacturer of the bad device.

With that out of the way, the next step you will probably need is something like an auto-switching power mux. TI has an excellent selection of muxes that will automatically switch between two voltages sources, depending on which are available. The keyword here is that you don't want self powered or bus powered, you want dual power. In a dual-power role, these muxes will prefer self power, and only switch over to bus power when there is no self power, and they are able to indicate to the MCU which power source is in use right now. I haven't used any but I think some are also designed to work with batteries.

http://www.ti.com/lsds/ti/power-management/power-multiplexer-mux-products.page