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.

BQ79656EVM-021: Steps for the Temperature measurement and storing the Temperature data

Part Number: BQ79656EVM-021
Other Parts Discussed in Thread: MSPM0G3507

Hi, 

I'm using 4 Bq79656 EVM for BMS application. I need to enable the Temperature measurement and need to store data as well. I'm using MSPM0G3507 for interfacing these devices.

I already enabled the Voltage measurement and also storing the voltage data.

Please provide me the steps for enabling the temperature measurement, for board and for coding side as well.

Thanks, and Regards

Abhaya Raj Mishra

  • Hi Abhaya,

    To set the GPIOs into OTUT & ADC mode:

    Enable TSREF: write 0x01 to 0x030A

    Set OTUT& ADC mode in GPIO_conf1-4: write 0x09 to registers 0x0E to 0x11

    Start Main ADC in continuous run mode: write 0x06 to 0x030D

    Regards,

    David

  • Sorry for the late reply, I was on leave for some days.

    Ok, I'll try it.
    One more thing, what about the multiplier for the raw data of temp ADC ?

    what should I multiply to get actual temp.

    Thanks and Regards

    Abhaya Raj Mishra

  • Hi Abhaya,

    For the die temperature, this is register 0x05AE and 0x05AF. Putting the high and low hex readings together and multiplying the decimal value by 0.025 will give you the temperature in Celcius.

    For the GPIOs, the NTC used should have temperature values that correlate to the resistance of the NTC. Since the GPIO pin is pulled up to TSREF and pulled down to ground through a thermistor, the voltage divider equation will define the resistance of the thermistor. Rntc = Rtsref/(Vtsref/Vgpio + 1) where Rntc = the ntc resistance, Vtsref = tsref voltage, Vgpio = gpio voltage, and Rtsref = the resistance of the Tsref pullup resistor. The customer then qualifies the resistance of the NTC over the temperatures wanted. This will then tell you which resistance relates to which temperature.

    Regards,

    David

  • Hi, I have enabled TSREF.

    Enable TSREF: write 0x01 to 0x030A

    but i'm getting 0 value for TSREF.

    What is wrong can you please help?

    and one more thing, I have enabled these as well.

    Set OTUT& ADC mode in GPIO_conf1-4: write 0x09 to registers 0x0E to 0x11

    I'm getting 0.273899 value for the GPIO.

    is it right?

  • Hi Abhaya, 

    When you write 0x01 to 0x030A, is TSREF reading 0V with a multimeter? If you read the register what does 0x030A read?

    I'm getting 0.273899 value for the GPIO.

    is it right?

    Can you post what resistors/ntc is connected to the GPIOs/TSREF so that I can give a better answer on this?

    Regards,

    David

  • When you write 0x01 to 0x030A, is TSREF reading 0V with a multimeter? If you read the register what does 0x030A read?

    I write 0x01 to 0x30A and after that I'm reading the TSREF_HI(0x58C) and TSREF_LO(0x58D). This is showing 0 value.

  • Hi Abhaya,

    TSREF is connected to the main ADC. If the main ADC is not running then TSREF will  not be updating.

    Start Main ADC in continuous run mode: write 0x06 to 0x030D

    Regards,

    David

  • //set up the main ADC
        WriteReg(0, ACTIVE_CELL, 0x0A, 1, FRMWRT_ALL_W);    //set all cells to active
        WriteReg(0, ADC_CONF1, 0x02, 1, FRMWRT_ALL_W);      //26Hz LPF_Vcell (38ms average)
        WriteReg(0, ADC_CTRL1, 0x0E, 1, FRMWRT_ALL_W);      //continuous run, LPF enabled and MAIN_GO
        delayus(38000+5*TOTALBOARDS);                       //initial delay to allow LPF to average for 38ms (26Hz LPF setting used)
    
    
        //set up tmepareture
    
    
        WriteReg(0, CONTROL2, 0x01, 1, FRMWRT_STK_W); //to enable the TSREF
        delayms(2);
    
        ReadReg(0, TSREF_HI, Tref, 2, 0, FRMWRT_ALL_R);
        uint16 Tref_T = (Tref[0] << 8) | Tref[1];
        printf("\n");
        printf("%d\t",Tref_T);
    
    
        // here abhaya changed 0x41 to 0x09 and enable 2,3,4 GPIO as well//
    
        WriteReg(0, GPIO_CONF1, 0x09, 1, FRMWRT_STK_W); //-   Configure GPIO1 for temperature measurement
        WriteReg(0, GPIO_CONF2, 0x09, 1, FRMWRT_STK_W); //-   Configure GPIO2 for temperature measurement
        WriteReg(0, GPIO_CONF3, 0x09, 1, FRMWRT_STK_W); //-   Configure GPIO3 for temperature measurement
        WriteReg(0, GPIO_CONF4, 0x09, 1, FRMWRT_STK_W); //-   Configure GPIO4 for temperature measurement
    
    
    
    
    
        WriteReg(0, OTUT_THRESH, 0xFF, 1, FRMWRT_STK_W);  //
        WriteReg(0, OTUT_CTRL, 0b01, 1, FRMWRT_STK_W); //

    Please confirm this sequence is fine?

    Thanks and Regards

    Abhaya Raj Mishra

  • Hi Abhaya,

    Please move lines 1-5 to after line 25 as the GPIOs and TSREF should be configured before adc_go is enabled.

    Regards,

    David

  • Ya I changed accordingly, but still i'm getting TSREF value as 0.

  • Hi Abhaya,

    Can you confirm on your board that TSREF is 5V with a multimeter? If TSREF is reading 5V with a multimeter, try adding a delay of 2ms after enabling TSREF.

    Regards,

    David

  • Ok, sure I'll try it.

  • In multimeter also it is showing 0 V.

    what should be done?

  • Hi Abhaya,

    it seems that your device is not communicating with the BQ79656. Here are two items I need that can help:

    1. Setup: Can you send a picture of how the microcontroller is connected to the BQ79656?

    2. Waveforms: Can you send an oscilloscope screenshot of RX and TX on the BQ79656 board? This screenshot should record you sending a read frame of 0x301 on the RX line and the BQ79656's response on the TX line.

    Regards,

    David

  • Ok i'll do it. Please give me some time.

    Thank you.