This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ76930的I2C通讯问题

Other Parts Discussed in Thread: BQ76930

今天板子终于到手了,现在正在调试IIC,BQ76930的LDO能正常输出3.3V,现在在单步调试的时候,发现接受不到BQ76930的ACK信号,

if(!iic_start())
{
return 0;
}
send_one_byte(I2C2_SLAVE_ADDRESS7);

if(!wait_ack())
{
iic_stop();
return 0;
}

在我发送完器件的地址(0x18)后,就进入了IIC_STOP();直接跳出了

  • 我是用的STM32L152作为MCU,  采用PB6和PB7作为SCL和SDA,没有用硬件IIC,采用的是模拟I2C,这个模拟I2C读写程序,我已经在STM32F103ZET6上成功读写EEPROM (24L02),现在移植过来的,单步调试 每次等不到BQ76930的ACK而跳出

    if(!iic_start())
    {
    return 0;
    }
    send_one_byte(I2C2_SLAVE_ADDRESS7);             //I2C2_SLAVE_ADDRESS7 = 0x18

    if(!wait_ack())
    {
    iic_stop(); 
    return 0;
    }
    send_one_byte(writeaddr);

    wait_ack();

    while(writelen--)
    {
    send_one_byte(*data);

    iic_delay(20);

    wait_ack();

    data++;
    }
    iic_stop();

    iic_delay(DELAY_TIME);

    return 1;