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: Getting started with the

Part Number: BQ3060
Other Parts Discussed in Thread: BQEVSW, BQSTUDIO, EV2400

Hi All,

I am new to the BQ3060 device and i need a little help to get started.  The device has been enclosed in a battery pack and already configured.  So my next step is to talk to this device with SMBus.  Could somebody give me the first commands to receive the current battery voltage.  I am guessing a wake up and voltage command are required.  I cannot seem to find any examples to get me started.

Look forward to you reply.

Rocketman

  • hi Rocketman

    I would encourage you to use bqevsw first for evaluation of the pack before trying to use a uC to communicate with the device. The technical reference manual has a description of all the gauge registers

    thanks

    Onyx

  • Hi Onyx,

    Thank you for your reply. 

    I have confirmation from the battery supplier the BQ3060 is configured correctly.  Could somebody confirm my psuedo code commands send from a micro to retrieve battery voltage level are correct, mainly the process and hex numbers.  Below is an example of my code.  

    Thanks,

    Rocketman46

    start_smbus();
    write_byte_smbus(0x16); // address for write
    write_byte_smbus(0x03); // battery mode command byte
    restart_smbus();
    write_byte_smbus(0x16); // address for read
    write_byte_smbus(0x16); // battery status
    battery_voltage = read_byte_smbus();
    ack_polling_smbus();
    stop_smbus();
    


  • Hi Onyx,

    Thank you for your reply. 

    I have confirmation from the battery supplier the BQ3060 is configured correctly.  Could somebody confirm my psuedo code commands send from a micro to retrieve battery voltage level are correct, mainly the process and hex numbers.  Below is an example of my code.  

    Thanks,

    Rocketman46

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    start_smbus();
    write_byte_smbus(0x16); // address for write
    write_byte_smbus(0x03); // battery mode command byte
    restart_smbus();
    write_byte_smbus(0x16); // address for read
    write_byte_smbus(0x16); // battery status
    battery_voltage = read_byte_smbus();
    ack_polling_smbus();
    stop_smbus();
  • Hello

    I requested you used bqstudio to evaluate-meaning testing sending commands and communicating with the device to understand the sequence of commands to send before trying to communicate with the device with your micro. Once you understand how to do this in bqstudio, doing this with your micro wouldn't be too difficult

    App note above discusses smbus and how to use it. 

    This other app note below has sample code for communicating/calibrating the device.

    Unfortunately, i am not a programmer so i am unable to verify the accurateness of your code.

    thanks

    Onyx

    thanks

    Onyx

  • Hi Onyx,

    Thanks for your reply.

    As your tech support team have mentioned, this is now an end of line chip, that requires an end of line programmer (EV2300) to program it.  The most up to date programmer is the EV2400, and i have purchased this.  However with this new programmer, i cannot talk to the chip.  So i am trying to guess the code without using TI studio.

    Thanks, 

  • Hi!

    At your pseudocode you are trying to read both Battery Mode, Battery Status and Voltage at single SMBUS transaction.

    This is wrong approach. Try read one parameter at one transaction. As well Read Address should have R/W-bit set.

    Try following code to read Battery Mode

    • start_smbus();
    • write_byte_smbus(0x16); // address for write
    • write_byte_smbus(0x03); // battery mode command byte
    • restart_smbus();
    • write_byte_smbus(0x17); // address for read
    • BM_LSB = read_byte_smbus(); // battery mode LSB read from device
    • BM_MSB = read_byte_smbus(); // battery mode MSB read from device
    • stop_smbus();
    Regards.
  • Hi Igor,

    Thanks for your help.

    I have translated your psuedo code into c code and i get the below results on the scope.  For some reason my Write and Read are dropping into 7bit mode so it displays W:0B and R:0B.  However i am able to change the first data package and this seems to update ok, 03, 04, 05 etc.  Reading back data from the battery i seem to get 81 and FF.  I am pretty sure this is not battery voltage.  Does this mean the command i am sending is incorrect?

    Attached is the scope screen shot.

    Look forward to your reply.

    Rocketman46

  • In example above it was Battery Mode command to read (i.e. 0x03), so if you want to read Voltage which is SBS(0x09), then pseudocode should look like this

    • start_smbus();
    • write_byte_smbus(0x16); // address for write
    • write_byte_smbus(0x09); // Voltage command byte
    • restart_smbus();
    • write_byte_smbus(0x17); // address for read
    • V_LSB = read_byte_smbus(); // Voltage LSB read from device
    • V_MSB = read_byte_smbus(); // Volatge MSB read from device
    • bPEC  =  read_byte_smbus();  // PEC byte
    • stop_smbus();

    then you should check received PEC byte, if it's Ok then received data bytes are valid and you could get the Voltage using V_LSB and V_MSB,

    Voltage = (V_MSB<<8) | V_LSB;       // it's in C syntax

    Good luck!