This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

bq27621-G1 I2C Process (write and read)

Hello guys,

As I am almost ready to complete my project, the bq27621-G1 is the only part that I made to work roughly and now I want to fully understand how it works so I can utilize it.

Starting I have successfully read the DEVICE_TYPE (0x0621) by I2C_write(0xAA,0x00,0x01) and I2C_read(0xAA,0x00).  Now I want to read the Chem_Type (0x08), so i did a I2C_write(0xAA,0x00,0x08) and I2C_read(0xAA,0x00) and it returns 0x1202.  Now if I try to do the two of them together one after the other, the first returns OK but the second just returns as the first.

Is there a proper way of sending and what to make more than one read at a time.... if I'm doing it properly ;)

Thanx in advance

GM

  • Hi Georgios,

    It seems that you have read the correct Chem_ID as it is the default for this device (x1202)

    Can you clarify what you mean by do the two of them together? Which two things are you trying to do?

    Best,
    Justin
  • Hello Justin,

    Thanx for the reply. When I mean to do them together I mean something like

    I2C_write(0xAA,0x00,0x01)
    I2C_read(0xAA,0x00)

    I2C_write(0xAA,0x00,0x08)
    I2C_read(0xAA,0x00)

    This way I get the correct Dev_Type , but the Chem_ID returns 0x0621 rather than 0x1202 as it does if i do it by itself.... im guessing time issue or the I2C... I put on some delay and didn't work and waited for the I2C to be freed before I send the next I2C command and still it persists. Any ideas?

    Thanx again.
  • Hi Georgios,

    I believe the problem is that you should be sending 0x0001 and 0x0008 for the commands not 0x01 and 0x08. Please see the following:

    Best,

    Justin