I'm using the bq27505 Fuel Gauge with an own Evaluation Board.
I can Send Commands and Subcommands and I can read the Flash.
My Problem is, that I can't write the Flash.
There is no internal Error, the Temperature is inside the Ranges, the Voltage is over the Flash Update OK Voltage.
The WAIT_ID Flag is activated. Could this be the failure? What's about the Checksum? Do I have to read out the Checksum?
Could anyone send me an Example how I write the Flash? I'm using following C-Code, existing on a microcontroller:
/***Activate Flash***/
i2c_start(); //Send Start Condition
i2c_write(0xaa); //Adress from Device, R/W'=0, Writing
i2c_write(0x61); //Command to activate Flash
i2c_write(0x00); //Command to activate general Flash
i2c_stop(); //Send Stop Condition
DelayMs(1);
/***Send Class***/
i2c_start(); //Send repeated Start
i2c_write(0xaa); //Adress from Device, R/W'=0, Writing
i2c_write(0x3e); //Command to determine DataFlashClass
i2c_write(usb_buffer_flwrite[2]);//write specific DataFlashClass
i2c_stop(); //Send Stop Condition
DelayMs(1);
/***Send Block Value***/
i2c_start(); //Send repeated Start
i2c_write(0xaa); //Adress from Device, R/W'=0, Writing
i2c_write(0x3f); //Command to determine DataFlashBlock
i2c_write(usb_buffer_flwrite[3]);//write specific DataFlashBlock to BlockData Register
i2c_stop(); //Send Stop Condition
DelayMs(1);
/***Access Value in BlockData memory***/
i2c_start(); //Send repeated Start
i2c_write(0xaa); //Adress from Device, R/W'=0, Writing
i2c_write(block_data_flwrite); //write DataFlashBlock Offset to Determine Value to be write in BlockData Register
i2c_stop(); //Send Stop Condition
DelayMs(1);
/***write Flash Data***/
i2c_start(); //Send repeated Start
i2c_write(0xaa); //Adress from Device, R/W'=0, Writing
i2c_write(usb_buffer_flwrite[6]); //Write Data to buffer, ACK
i2c_write(usb_buffer_flwrite[5]); //Write Data to buffer, NACK
i2c_stop(); //Send Stop Condition
Thank you and best Regards!