USB - BC1.2检测

如何把USB的D+/D-同时接到Charge IC和HOST IC上?

这个问题,一般是因为HOST IC不支持BC 1.2,需要charge IC来支持。否则的话,可以HOST IC判断出BC 1.2后,再控制charge IC即可。

在TI的网站论坛上,查询到了一个技术回复。

1,Charge ID和HOST ID一起直接连到USB接口上,共享D+/D-。

BQ24253: D+D- connection mode - Power management forum - Power management - TI E2E support forums

BQ25629: USB D+/D- connection and BC1.2 charger detection - Power management forum - Power management - TI E2E support forums

BQ25601D: Does D+/D- detection interfere with USB communication over D+/D- - Power management forum - Power management - TI E2E support forums

BQ25895M: BQ25895M & D+ D- & MCU - Power management forum - Power management - TI E2E support forums

当不需要 D+/D- 引脚进行输入限流检测时,充电芯片将 HIZ D+/D- 引脚,以便其他设备可以驱动 D+/D- 引脚。

The charger will HIZ D+/D- pins when D+/D- pins are not needed for input current limit detection so that other devices may drive D+/D- pins. 

[BQ25629]

请问主机需要在 HIZ 中保持 D+/D- 多长时间才能完成检测过程?

是否有办法在检测完成时检查 bq25629 的寄存器?

Please advise how long does the host need to keep the D+/D- in HIZ for the detection process to complete?

Is there a way to check on bq25629's register when the detection is done?

输入源类型检测完成后,VBUS_STAT 位将被更新,以显示检测到的输入源类型。请同时使用 VBUS_STAT 位(REGx1E[2:0])和 VBUS_FLAG(REGx21[0])来检查检测是否完成。

Upon the completion of input source type detection, VBUS_STAT bits are updated to indicate the detected input source type. Please use VBUS_STAT bits (REGx1E[2:0]) and VBUS_FLAG (REGx21[0]) together to check if the detection is completed.

[ BQ25601D ]

您能告诉我在 uC 开始使用线路之前,D+/D- 必须保持 HiZ 状态多长时间吗?

Can you tell me how long the D+/D- must stay in HiZ state until the uC can start with using the line?   (uC = uController)

输入 DPDM 检测取决于输入源类型。为了安全起见,最好在输入源插入后至少等待 1 秒钟,或者监控下面的位。

The input DPDM detection is dependent on the input source type. To be safe, it is better to wait at least 1 second after an input source plugs in or monitor the bits below.

[ BQ24253 ]

如果我用 USB 给 BQ24253 供电,同时需要 USB 传输数据,是否必须确保 USD 的 D+D- 和 BQ24253 的 D+D- 始终保持连接?在此前提下,BC1.2 检测是在开机后立即进行的,检测完成后,D+D- 就可以正常用于数据传输了,对吗?

If I use USB to power BQ24253 and simultaneously need USB to transfer data, do I have to ensure that USD's D+D- and BQ24253's D+D- are always connected? Under such a premise, BC1.2 detection is carried out right after power-on, and after the detection is completed, D+D- can be used normally for data transmission, right?

充电器仅在首次开机后的 1.5 秒内使用 D+/D- 线路。 之后,D+/D- 引脚将变为高阻抗。

The charger only uses the D+/D- lines for the first 1.5 seconds after initial power up.  After that time, the D+/D- pins go high impedance.

[ BQ25895 ]

在一般应用中,大多数客户会将 BQ25895 的 D+/D- 引脚与 MCU 的 D+/D- 引脚相连。

对于 BQ25895,D+/D- 引脚在完成输入电源检测后将断开。

In general application, most customers will connect BQ25895 D+/D- pins with MCU D+/D- pins.

For BQ25895 D+/D- pin will be open after it finished input power source detection.

2,  使用可以转接D+/D-信号的Charge IC。

TPS25762-Q1: Query regarding BC1.2 and D+, D- - Power management forum - Power management - TI E2E support forums

BQ25895M: BQ25895M & D+ D- & MCU - Power management forum - Power management - TI E2E support forums

如果HOST IC没有集成BC1.2的控制器,那charge IC可以选择TPS254900A-Q1.

Product page:

TPS254900A-Q1 data sheet, product information and support | TI.com

USB的D+/D-,输入到charge IC,然后再输出,可以接到HOST IC上。

3,使用USB switch开关(external multiplexer)来隔离Charge IC和HOST IC的D+/D-,避免互相影响。

BQ25629: USB D+/D- connection and BC1.2 charger detection - Power management forum - Power management - TI E2E support forums

BQ24295: Help with BQ24295 USB Data Lines, PMID Capacitance - Power management forum - Power management - TI E2E support forums

BQ25886: D+/D- and USB line - Power management forum - Power management - TI E2E support forums

当插入 VBUS 电源时,D+/D- 引脚用于 USB 输入限流检测。在充电器输入限流检测过程中,主机必须能够 HIZ D+/D- 引脚,以便 D+/D- 引脚由充电器驱动。如果主机无法 HIZ D+/D- 引脚,则需要一个 USB 开关来隔离主机和充电器的 D+/D- 引脚。

D+/D- pins are used for USB input current limit detection when VBUS power is plugged in. During the charger input current limit detection process, the host must be able to HIZ D+/D- pins so that D+/D- pins are driven by the charger. If the host is unable to HIZ D+/D- pins, a USB switch is needed to isolate the D+/D- pins of the host and the charger.

只有在插入 VBUS 输入源的第一秒内,D+/D- 线路上的设备能保持高阻抗时,才可以在 D+/D- 线路上连接设备。在此期间,充电器将执行 USB BC1.2 检测,以确定输入电流限制。之后,设备可能会接管 D+/D- 线路。如果该设备不能做到这一点,我建议使用 MCU 控制的 USB 开关。

Attaching a device on the D+/D- lines is only acceptable if that device can keep the D+/D- line high impedance for the first second when the input source on VBUS is plugged in. During this time, the charger will perform the USB BC1.2 detection to determine the input current limit. After that, the device may take over the D+/D- lines. If this device does not do this, I would suggesting utilizing a USB switch with MCU control.

你能说出一个可以用于此目的的 USB 开关吗?Can you name an USB switch that could be used for that purpose?

建议的USB开关(USB mux),TS3USB221A,TS3USB221A data sheet, product information and support | TI.com

[ BQ25895 ]

D+/D- 连接有两种解决方案。一种是如上所述直接连接在一起。另一种是使用外部多路复用器。但是,即使 BQ25895M 开启了 D+/D- 引脚,但仍有少量电容会影响 D+/D- 信号质量。因此,有些客户会使用外部多路复用器来改善 D+/D- 信号质量。

There are two solutions for D+/D- connection. One is directly connected together as mentioned above. The other is using external multiplexer. But even BQ25895M open D+/D- pin but there still has few capacitance to impact D+/D- signal quality. So some customers will use external multiplexer to improve D+/D- signal quality.

您可以使用 BQ25895M 的 DESL 引脚(引脚 24)来控制该多路复用器。通过 10-KΩ 电阻器将 DSEL 连接到逻辑轨。该引脚通常为浮动引脚,通过外部电阻上拉。在输入源类型检测期间,该引脚驱动低电平,表示设备正在进行 D+/D- 检测,需要控制 D+、D- 信号。检测完成后,当检测到 MaxCharge™ 适配器时,该引脚保持低电平。检测到其他输入源类型时,该引脚返回浮动状态,并通过外部电阻拉高。

And you can use BQ25895M's DESL pin (pin24) to control this multiplexer. Connect the DSEL to a logic rail via 10-KΩ resistor. The pin is normally float and pull-up by external resistor. During Input Source Type Detection , the pin drives low to indicate the device D+/D- detection is in progress and needs to take control of D+, D- signals. When detection is completed, the pin keeps low when MaxCharge™ adapter is detected. The pin returns to float and pulls high by external resistor when other input source type is detected.

[ BQ25886 ]

如果有主机共享 D+/D- 线路,则需要在主机上使用多路复用器或软件延迟,以便首先进行检测。检测大约需要 1 秒钟。D+/D- 检测流程完成后,D+ 和 D- 引脚将变为 HIZ。

If there is a host sharing the D+/D- line you will need to use the MUX or a software delay on the host to allow for the detection to occur first. The detection takes approximately 1 second. After the D+/D- detection flow is complete, the D+ and D- pins will go HIZ.

下面几个链接是重复信息:

BQ25620: D+ D- with USB MCU? - Power management forum - Power management - TI E2E support forums

BQ25600D: D+/D- connection - Power management forum - Power management - TI E2E support forums

4,实际案例分析

Host IC: i.MX25

Charge IC: BQ24251

USB Switch: WAS7227Q

a. 硬件设计上,USB connector的D+/D- 同时接到charge IC和USB switch的输入。Host IC的USB接口接到USB Switch的一路D+/D-输出上。

b. 软件设计上,上电后,USB switch默认是关闭的。当Charge IC检测到USB插入,并且Input Source type detect结束后,再根据情况,如果是SDP或CDP,就打开USB switch的一路通道,使Host IC的USB连接到USB接口。如果是DCP或其他情况,就保持USB switch关闭。

c. 为了最大化保证USB通信,可以在USB DCP情况下,也打开USB Switch,并等待一段时间,再检查USB是否有通讯。如果没有通讯,表示USB通讯功能不可用,再关闭USB Switch。

USB连接器接入Charge IC的D+/D-,由Charge IC来负责检测是否有USB设备插入,然后再去操作USB Switch。

Charge IC检测完input source之后会将D+/D-设置为高阻态,不会影响USB通信。

5,USB Switch: WAS7227Q

USB High speed (480Mbps), DPDT Analog Switch。

WAS7227Q 是一款高性能、双刀双掷 (DPDT) CMOS 模拟开关,采用 +2.5V 至 +5.5V 单电源供电。

The WAS7227Q is a high performance, double pole double throw (DPDT) CMOS analog switch that operates from a single +2.5V to +5.5V power supply.

WAS7227Q 专为手机和消费类应用中高速 USB2.0 信号的开关而设计,如手机、数码相机,以及配备集线器或USB控制器, 但USBI/O 数量有限的笔记本电脑。

The WAS7227Q is designed for switching of high-speed USB2.0 signals in handset and consumer applications, such as cell phones, digital cameras, and notebooks with hubs or controllers with limited USB I/Os.

WAS7227Q 采用 QFN1418-10L 封装。标准产品为无铅和 无卤素。

The WAS7227Q is available in QFN1418-10L package. Standard products are Pb-Free and halogen-Free.

Pin descriptions

Function descriptions

Logic symbol and typical applications

控制输入必须保持高电平或低电平,不得悬空。

Control input must be held high or Low, it must not float

6,支持BC 1.2的Host IC

在使用Ingenic的X1600芯片时,Linux kernel里的kernel\drivers\usb\common\common.c,包含了BC 1.2的功能。

static const char *const power_names[] = {

    [USB_POWER_UNKNOWN] = "UNKNOWN",

    [USB_POWER_SDP] = "Standard Downstream Port",

    [USB_POWER_DCP] = "Dedicated Charging Port",

    [USB_POWER_CDP] = "Charging Downstream Port",

};

const char *usb_power_string(enum usb_device_power type)

{

    if (type < 0 || type >= ARRAY_SIZE(power_names))

        type = USB_POWER_UNKNOWN;

    return power_names[type];

}

EXPORT_SYMBOL_GPL(usb_power_string);

代码里判断是否支持BC 1.2:

if(system("grep -E 'Dedicated Charging Port|Charging Downstream Port' /sys/class/udc/13500000.otg/power_type >/dev/null") == 0)

    return true;

而Freescale的i.MX25、i.MX6UL(L)和i.MX93里就没有BC 1.2的功能。

  • 10
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值