Back to the USB charger design
For some reason I started thinking about the USB charger that I had been designing.I started by trying to reboot how I was thinking about the I2C controlled charge sensing circuit. I was searching around for USB "specs" about a charging circuit. The problem that I had been running into last time was how to interface with iOS devices as well as Android and other device types seamlessly. The issue at hand is there are around four or five "specs" to let the device being charged know how much current is allowable. These are all different solutions to communicating the current without being smart enough to talk USB.The original "standard" allowed 100mA (or 500mA if you squinted) on a non-negotiated USB port. Apple made one standard (which arguably makes the most sense) by floating the D+ and D- lines to particular voltages. This allows it to be a nice and extensible spec. Early Android shorted the D+ and D- lines to indicate 1A-capability. Samsung added to this by not just shorting the lines, but pulling them up to 1.2V to let the device know it can pull 2A.Luckily I found a TI part that does all this without additional circuitry! The TPS2513A is a magic little chip! My previous design had a I2C switch to short the D+ and D- lines. That would've been OK, but not perfect since it's not doing the 1.2V pull-up. The bigger problem is that I would have to add more complexity to route traces to the switch along with having four voltage divider resistors for each port. This can be replaced by a tiny SOT-23 package an a decoupling cap. And, as a bonus it does two ports worth!The rest of the design I think has been simplified as well. I was going to have some analog switches to route the current sense signals back to the main processor. I found it was even cheaper to just slap in an 8-port analog-to-digital converter (ADC) -- not only simpler, but I can get a 12-bit ADC for the cost of a good switch. Neat.The only part that's really the same is the high-side current sensing system with a sense resistor for each port along with a sense amplifier. The amp I'm looking at can be had with four amps in a package so that simplifies things as well.Lastly, the FET driver can be replaced by a simple 16-port I2C expander.So the bill of materials (BOM) for 16 ports comes out to:
- 16x - USB connector
- 16x - FET to switch ports
- 16x - Current sense resistors
- 8x - USB charging port controller
- 4x - Current-sense amplifier
- 2x - 8-channel 12-bit ADC
- 1x - Port expander
- Bunch of low-value decoupling capacitors (~ 11 x 0.1µF)
This design would scale out to 64 ports with no I2C bus conflicts. It would just require a bigger board and a beefier power supply.I think based on the simplification I might be able to spec a two-layer board. This might be cheap enough for me to build up a couple examples. :-)