请问有BQ27621 的sample code可以参考下吗?
我读了下DEVICE_TYPE ,不是0621, I2C 验证过没问题,估计是读的命令不对。
先发送的Control 命令: 0x00 0x01
然后发送的Device TYPE sub command: 0x0001
各位高手帮忙看看问题在什么地方,谢谢!
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.
请问有BQ27621 的sample code可以参考下吗?
我读了下DEVICE_TYPE ,不是0621, I2C 验证过没问题,估计是读的命令不对。
先发送的Control 命令: 0x00 0x01
然后发送的Device TYPE sub command: 0x0001
各位高手帮忙看看问题在什么地方,谢谢!
我是用的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;
不好意思,我回帖回错了,我以为是我自己的帖子,我也在IIC通讯这卡住了,见谅哈!
参考bq27621-G1 Technical Reference (http://www.ti.com/lit/ug/sluuad4b/sluuad4b.pdf)第11页Application Examples,里面介绍命令怎么组合。
此外,I2C write address is 0xAA, read address is 0xAB.
TI提供了用MSP430 MCU I2C读写Gauge的示例代码,你参考下:http://www.ti.com.cn/analog/cn/docs/litabsmultiplefilelist.tsp?literatureNumber=slva413a&docCategoryId=1&familyId=412