Part Number:BQ34Z110
Tool/software: Code Composer Studio
I'm using the Atmega128 and BQ34Z11. I use the I2C between the Atmega128 and BQ34Z11.
When I construct the my circuit based BQ34Z110, refer to this website https://www.mikrocontroller.net/topic/339243
And I supply 12V to the my circuit.
And I don't connect the SRP, SRN because I hope to measure only battery voltage.
Then I start I2C with BQ34Z110 as below step by step.
As first step, I read value of Data Flash on BQ34Z110.
I got successful result.
As second step, I transmute the value of Data Flash on BQ34Z110. Then I checked the value received Data Flash on the BQ34Z110.
So thst's successful!!(I set up the value of Data Flash on BQ34Z110 by Voltage measure range = 14400[mV] and Capacity measure range = 2900[mA/h])
As third step, I send the command for reading the voltage of battery as below way to the BQ34Z110.
1. "Startbit --- 0xAA --- 0x08 --- Repeated START --- 0xAB --- Data Read(LSB) --- Data Read(MSB) --- End"
2. "Startbit --- 0xAA --- 0x08 --- Repeated START --- 0xAB --- Data Read(LSB) --- Data Read(MSB) --- End"
3. "Startbit --- 0x55 --- 0x08 --- Repeated START --- 0x55 --- Data Read(LSB) --- Data Read(MSB) --- End"
4. "Startbit --- 0xAA --- 0x08 --- 0x09 --- Repeated START --- 0xAB --- Data Read(LSB) --- Data Read(MSB) --- End"
5. "Startbit --- 0xAA --- 0x08 --- 0x09 --- Repeated START --- 0xAB --- Data Read(LSB) --- Data Read(MSB) --- End"
6. "Startbit --- 0x55 --- 0x08 --- End --- 0x55 --- Data Read(LSB) --- End --- Startbit --- 0x55 --- 0x09 --- End --- 0x55 --- Data Read(LSB) --- End
7. "Startbit --- 0x55 --- 0x08 --- End --- 0x55 --- Data Read(LSB) --- End --- Startbit --- 0x55 --- 0x09 --- End --- 0x55 --- Data Read(LSB) --- End
I always success the I2C but fail to get a result(MSB, LSB). I often received a LSB = 12 or 18(decimal) and a MSB = 00. I sometimes recieved a LSB = 224(decimal) a MSB = 46(decimal) and a LSB = 76(decimal) a MSB = 02(decimal).
I think, a result which I recieved is all wrong.
I don't know why I don't received right the result.
So....I hope to get that use successful a code with the BQ34Z110
I hope to get a code which to success reading the battery voltage using "Atmega" or "Arduino" serise.
Can youse give me successful a code??