我们的电源设计是容量可以扩展的设计,所以otp模式应该是用不了的。
在平台初始化的时候想通过I2c来动态的更改bq27220的设计容量,但我根据文档上的流程修改总是失败。请问我们该如何进行初始化?以下是我初始化的代码,希望指点一下。
难道直接初始化ram还需要加7.4v电压吗?
ret = write_I2C_bq(2,0×00, 0x01, 0x00); // 0x41
ret = write_I2C_bq(3,0×00, 0x14, 0x04); // 0x41
ret = write_I2C_bq(3,0×00, 0x72,0x36); //
ret = write_I2C_bq(3,0×00, 0xFF,0xFF); // for test, full access
ret = write_I2C_bq(3,0×00, 0xFF,0xFF); // for test, full access
ret = write_I2C_bq(3,0×00, 0x90,0x00); // for test, Enter in CFG_UPDATE
{nrf_delay_ms(2000);}
ret = write_I2C_bq(3,0x3e,0x9f,0x92);
ret = read_I2C_bq(1,0×60,0, &Decap_l);
printf("old_chksum1111111 ==============%x\r\n",Decap_l);
ret = read_I2C_bq(1,0×61,0, &Decap_l);
printf("Data_len11111111 ==============%x\r\n",Decap_l);
ret = read_I2C_bq(1,0×40,0, &Decap_l);
printf("old_dc_msb 1111111 ==============%x\r\n",Decap_l);
ret = read_I2C_bq(1,0×41,0, &Decap_l);
printf("old_dc_lsb 11111111 ==============%x\r\n",Decap_l);
if(ret != true) return ret; {nrf_delay_ms(2000);}
ret = write_I2C_bq(3,0×40, 0x13,0x88); ret = read_I2C_bq(1,0×60,0, &temp1); // Read 0x60 Old_Chksum
ret = read_I2C_bq(1,0×61, 0,&temp2); // Read 0x61 data_len
ret = read_I2C_bq(1,0×40,0, &Decap_l);
printf("design cap high222222 ==============%x\r\n",Decap_l);
ret = read_I2C_bq(1,0×41,0, &Decap_l);
printf("design cap low2222222 ==============%x\r\n",Decap_l);
ret = write_I2C_bq(3,0×60, 0xb0,0x24);
ret = write_I2C_bq(3,0×00, 0x91,0x00); // for test, Enter in CFG_UPDATE/
ret = read_I2C_bq(1,0x3b,0, &Decap_l);
{nrf_delay_ms(1000);}
ret = write_I2C_bq(3,0×00, 0x30,0x00); // return to SEALED mode
在这里读取3c,3d寄存器,仍然是默认的3000ma
yancheng shen:
请问你后面解决了吗 若是解决了 怎么解决的 可以指导一下吗 谢谢了
yancheng shen:
回复 Cheng.W:
帮忙看一下是不是写的有什么问题 特别是打标注的地方