Hi
Question:
Average current value of BQ34z100 from I2C - 1 byte data reads
Iteupnida very well.
CURRENT: 0x0018 -> olryeogo to read the current value
Returns the instantaneous current measured by the gauge
Source program I2CCOMMAND (); Public get down Where Have
Questions Olympique stuffy feeling.
To a communication control microcomputer ATMEGA 128 reads the instantaneous value of current
Control () Subcommand address 0018 Read (); value 0xffff comes.
Dream, please let me know how to get favor.
Thank you very much.
Example 1:
/ / ------------------------------------------------ -----
/ / Pack_Voltage Reading
/ / ------------------------------------------------ -----
I2C_start ();
I2C_write (0xaa);
I2C_write (0x08);
I2C_start ();
I2C_write (0xab);
vt_l = I2C_read (1);
I2C_stop ();
I2C_start ();
I2C_write (0xaa);
I2C_write (0x09);
I2C_start ();
I2C_write (0xab);
vt_h = I2C_read (1);
I2C_stop ();
Tx_Pack [0] = vt_h;
Tx_Pack [1] = vt_l;
/ ------------------------------------------------ -----
/ / Pack_Current Reading
/ / ------------------------------------------------ -----
// Current 0x0018 Read 0X0000 ----- ?
I2C_start ();
I2C_write (0xaa);
I2C_write (0x00);
I2C_write (0x18); / / current
I2C_stop ();
I2C_start ();
I2C_write (0xaa);
I2C_write (0x01);
I2C_write (0x00);
I2C_stop ();
I2C_start ();
I2C_write (0xaa);
I2C_write (0x00);
I2C_write (0xab);
I2C_write (0x00);
ac_l = I2C_read (1); --> Not Read_Data ?
I2C_stop ();
I2C_start ();
I2C_write (0xaa);
I2C_write (0x01);
I2C_write (0xab);
I2C_write (0x18);
ac_h = I2C_read (1); --> Not Read_Data ?
I2C_stop ();