Quantcast
Channel: Power management forum - Recent Threads
Viewing all articles
Browse latest Browse all 35901

BQ27411-G1, read values not possible to interpret

$
0
0

Hello everybody, i make a selfdesigned prototype with BQ27411-G1 for the LiPO
one cell gauge. The µC that communicate with BQ27411-G1 over I2C is Atmega1284P.
I try to read the all data(Temperature, Voltage, Flags ... State of Health) from IC, but
it doesnt completly work. The values in the array(data_back_fuel_gauge[ i ])
it´s not possible to interpret... At each read cycle it is almost values on the same place in
the array(data_back_fuel_gauge[ i ]).

i2c_master_start(0xAA) ; // Write
i2c_master_tx( 0x01 ) ; // Adress
i2c_master_start(0xAB) ; // Read

for( i = 0 ; i < 40 ; i++ )
{
data_back_fuel_gauge[ i ] = i2c_master_rx_continius_read() ;
}
data_back_fuel_gauge[ 40 ] = i2c_master_rx_last_byte_read() ;

i2c_master_stop() ;

I can read the BlockData( wat is this? ) with 0x40 command. The read Data( from adress 0x40)
is doesnt possible assing to any variable(Temperature, Voltage, Flags ... State of Health).
The read values( from adress 0x40) in the array(data_back_fuel_gauge[ i ])
it´s not possible to interpret... At each read cycle it is almost values( from adress 0x40)
on the same place in the array(data_back_fuel_gauge[ i ]).

i2c_master_start(0xAA) ; // Write
i2c_master_tx( 0x40 ) ; // Adress
i2c_master_start(0xAB) ; // Read

for( i = 0 ; i < 40 ; i++ )
{
data_back_fuel_gauge[ i ] = i2c_master_rx_continius_read() ;
}
data_back_fuel_gauge[ 40 ] = i2c_master_rx_last_byte_read() ;

i2c_master_stop() ;

I try with two differen ways to the Data read from BQ27411-G1, but without success.
Let me now about your previous experience. What i forget to do? What is wrong in my two ways?
Please help me :-))) and a´m sorry for my english.

With best regards from Germany, Hans Schmidt


Viewing all articles
Browse latest Browse all 35901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>