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.

BQ3060 I2C interface with dsPIC33

Other Parts Discussed in Thread: BQ3060

Hi,

I have just had a battery pack dumped on my desk with the instructions to get the data read from the batteries through SMbus. I was only given the datasheet of the BQ3060, which is the power management chip on the circuit board of the pack. [The pack is labelled "Samsung Cells" , Li-Ion 10.8V, IML1170] . Output of the pack reads Pack+, P+, SMD, SMC, T, P-, Pack-. 

I have never dealt with battery management before and our products work with Microchip dsPIC devices. I know that SMBus is a subset of I2C and I can initialize the PIC i'm using with SMBus levels and speed.

I connected the SMD and SMC outputs of the battery pack (which are the SMD and SMC of the BQ3060) directly to the corresponding I2C pins of the PIC.
From what I read on the datasheets, BQ3060 works on a slave address of 0x16. However, I did not find anywhere what I expect back from the BQ3060 as and Acknowledge or data. I tried to send a simple "Quick Message" of  Start, Address,R/W and waited for an Acknowledge that never came.

The commands I sent from the I2C module of the PIC are:

-> Start  ( ~~~~\____ )                   

-> Address + Read (0x17) 

-> Wait for Acknowledge (I expect here for an acknowledge to be sent by the BQ3060 and set the I2C ACK bit of the module, but this never arrives).

-> Stop ( ___/~~~~ )

Is there a specific command which can tell me if the BQ3060 is ON or not? There is 6.9V on the BAT and the Pack pins, I assume connected to the battery pack.

I apologise for the simple questions which might be too simple, but I have never used this kind of product before, or the SMBus portocol. I have looked at the datasheets available (SLUU319/507/502/132) but I cannot find the simple answer I am looking for....if in fact it is that simple. 

thanks for your help

Mario

  • What compiler are you using with your dsPIC?
  • MPLAB IDE 8.92 with C30 Compiler.
  • I'm afraid I won't be of much help. In my experience, the C30 compiler is just one step short of assembly language. I use the CCS PIC-C compiler. Here's how I handle things, you may be able to glean something from this:

    This is just a single function but the others are similar.

    unsigned int1 SBSReadUnsignedWord( unsigned int8 &BatteryRegister, unsigned int16 &Result )
    {
    unsigned int8 LowByte, HighByte;
    unsigned int1 battery_response;
    const unsigned int8 SBSBatteryWrite = 0x16;
    const unsigned int8 SBSBatteryRead = 0x17;

    i2c_start();
    battery_response = i2c_write(SBSBatteryWrite);
    if( COM_ACK == battery_response )
    {
    battery_response = i2c_write(BatteryRegister);
    }
    if( COM_ACK == battery_response )
    {
    i2c_start();
    }
    battery_response = i2c_write(SBSBatteryRead);
    if( COM_ACK == battery_response )
    {
    LowByte = i2c_read(SBS_ACK);
    HighByte = i2c_read(SBS_NAK);
    }
    i2c_stop();

    Result = make16( HighByte, LowByte );

    return battery_response;
    }

    This function would be called like this:

    SBSReadUnsignedWord(SBSRegister.Temperature, Battery.Temperature)

    Where SBSRegister is a structure with the addresses and Battery is a structure to hold the values.

    SBS_ACK is 1
    COM_ACK is 0

    This is the start, there is more to a whole package of functions but they are all similar. Play with reading a single register, when you get that one, move on.

    Good luck,
    David