BQ25622: BQ25622 OTG 输出配置不生效

Part Number: BQ25622

我用芯片 BQ25622 进行OTG输出功能。采用函数initOtg(true)对寄存器0x0a、0x0c、0x18进行了设置;然后每过1秒执行resetWatchdog()对看门狗进行复位;但是在后续的若干时间内,OTG没有正常启动,我通过寄存器值获取信息,VBUS_STAT标志始终为0、EN_OTG一直等于1 ;没有出现错误信息,各寄存器值如下。这种情况可能是什么原因导致的呢,我要如何进行处理? 


0x0A = 0x350  I = 0x35
0x0C = 0x1140  V = 0x45
0x15 = 0x1C

0x16 = 0xA1
0x18 = 0x44  EN_OTG = 1
0x19 = 0xC4
0x1A = 0x3D
0x1D = 0x00
0x1E = 0x00 VBUS_STAT=0
0x1F = 0x00  OTG_FAULT_STA = 0   TS_STAT = 0 
0x20 = 0x00
0x21 = 0x00
0x22 = 0x00

 

void initOtg(bool en)
{
    uint16_t data16;
    data16 = ((uint16_t)(0x35)) << 4;
    writeReg16(0x0a, data16);
    readReg16Print(0x0a);
    data16 = ((uint16_t)(0x45)) << 6;
    writeReg16(0x0c, data16);
    readReg16Print(0x0c);
    readReg16(0x18, data16);
    if (en)
    {
        data16 = data16 | (1 << 6);
    }
    else
    {
        data16 = data16 & ~(1 << 6);
    }
    writeReg16(0x18, data16);
    readReg16(0x18, data16);
    if ((data16 & (1 << 6)))
    {
        printf("EN_OTG = 1\n");
    }
    else
    {
        printf("EN_OTG = 0\n");
    }
    usleep(1000 * 30);
}

bool resetWatchdog()
{
    uint8_t reg_value;
    readReg8(0x16, reg_value);
    reg_value |= (1 << 2);
    writeReg8(0x16, reg_value);
    return true;
}

  • I used the chip BQ25622 for the OTG output function. I set the registers 0x0a, 0x0c, and 0x18 by calling the function initOtg(true). Then, every second, I executed the resetWatchdog() to reset the watchdog. However, for several subsequent periods, the OTG did not start normally. I obtained information from the register values, and the VBUS_STAT flag remained 0 and EN_OTG was always equal to 1. No error messages were displayed. The register values are as follows. What could be the cause of this situation and how should I handle it?

  • 您好,

         请检查图中进入OTG模式的条件都要满足。