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: Temperature measurement

Part Number: BQ79656EVM-021

Tool/software:

Hi,

  • I'm using 4 Bq79656 EVM. for cell voltage and temperature monitoring. (without master (BQ79600)).

I am perfectly getting the voltage data from it, but for the temperature measurement, I enabled the TSREF but getting 0 value. (I checked with the multimeter as well it is coming 0V in TSREF pin)

please help me in this.

  • And please let me know the steps need to be followed to collect temperature data from GPIO pins (Hardware and software side as well).
  • What is the multiplier need to be used for ADC conversion as well.

Thanks, and Regards 

Abhaya Raj Mishra 

  • Hi Abhaya,

    Hardware: Verify that the jumper J5 is connected on the EVM. This will connect TSREF to the NTC circuit. Then check if the TSREF is powered. 

    Software: Configure GPIOs as ADC and OTUT. 0b001 to the relevant GPIO register. 

    Multiplier for ADC GPIO: 

    Best regards,

    Barry

  • Yes, J5 jumper is connected, and I enable the TSREF as well ( WriteReg(0, CONTROL2, 0x01, 1, FRMWRT_STK_W); //to enable the TSREF
    waitTime(WAIT_100ms);).

    But TSREF is not powering on, it is still giving 0V.

    Please help in same.

  • Hi Abhaya,

    TSREF can take 6 seconds to fully enable, put a longer delay. If that doesn't work, please share more of your code. Also does it work with just one device in the stack?

    Best regards,

    Barry

  • Hi, I applied 10 s delay, but still, it is not working, 
    I'm trying with only one BQ79656 device.

    I'm getting the voltage data perfectly.

    I've attached the part of code, please check it once.

    wakeup_BQ();
        init_ASCLIN_UART();                 /* Initialize the UART module */
        //initMcmcan();                       /* Initialize the CAN module */
        CANInit();
        waitTime(WAIT_35ms);
        AutoAddress(); //auto address sequence
        waitTime(WAIT_1ms);
    
        //    //RESET ANY COMM FAULT CONDITIONS FROM STARTUP
        //      WriteReg(0, FAULT_RST1, 0xFF, 1, FRMWRT_STK_W); //Reset faults on stacked devices
        //      waitTime(WAIT_1ms);
        //      WriteReg(0, FAULT_RST2, 0xFF, 1, FRMWRT_STK_W); //Reset faults on stacked devices
        //      waitTime(WAIT_1ms);
        //      WriteReg(0, Bridge_FAULT_RST, 0x22, 1, FRMWRT_SGL_W); //Reset FAULT_COMM and FAULT_SYS on bridge device
        //      waitTime(WAIT_1ms);
        //
        //      //ENABLE BQ79616-Q1 MAIN ADC
        //      WriteReg(0, ACTIVE_CELL, 0x0A, 1, FRMWRT_STK_W); //set all cells to active
        //      waitTime(WAIT_1ms);
        //      WriteReg(0, ADC_CTRL1, 0x06, 1, FRMWRT_STK_W);   //continuous run and MAIN_GO
        //      waitTime(WAIT_5us*TOTALBOARDS + 192);                    //5us reclocking per board and 192us for round robin to complete
    
    
        WriteReg(0, FAULT_RST2, 0x03, 1, FRMWRT_ALL_W);
        waitTime(WAIT_4ms);
        //delayus(4000); //4ms total required after shutdown to wake transition for AFE settling time, this is for top device only
        WriteReg(0, FAULT_MSK2, 0X40, 1, FRMWRT_ALL_W); //Mask CUST_CRC so config changes don't flag a fault
        waitTime(WAIT_1ms);
        ResetAllFaults(0, FRMWRT_ALL_W);
        waitTime(WAIT_4ms);
    
        //set up temperature
    
        WriteReg(0, CONTROL2, 0x01, 1, FRMWRT_STK_W); //to enable the TSREF
        waitTime(TimeConst_10s);
    //
    //    ReadReg(0, TSREF_HI, Tref, 2, 0, FRMWRT_ALL_R);
    //    waitTime(WAIT_2ms);
    //    uint16 Tref_T = (Tref[0] << 8) | Tref[1];
    //    //    uint16 Tref_T = (Tref[8+4] << 8) | Tref[8+5];
    //    printf("\n");
    //    printf("%f\t",Tref_T*0.00016954);
    
    
        // 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
        waitTime(WAIT_2ms);
        WriteReg(0, GPIO_CONF2, 0x09, 1, FRMWRT_STK_W); //-   Configure GPIO2 for temperature measurement
        waitTime(WAIT_2ms);
        WriteReg(0, GPIO_CONF3, 0x09, 1, FRMWRT_STK_W); //-   Configure GPIO3 for temperature measurement
        waitTime(WAIT_2ms);
        WriteReg(0, GPIO_CONF4, 0x09, 1, FRMWRT_STK_W); //-   Configure GPIO4 for temperature measurement
        waitTime(WAIT_2ms);
    
        WriteReg(0, ADC_CTRL1, 0x06, 1, FRMWRT_STK_W); // - Start Main ADC in continuous run mode
        waitTime(WAIT_2ms);
        // **********************************Setting UVOV and UTOT threshold values*****************************//
    
    
    
        WriteReg(0, OV_THRESH, 0x23, 1, FRMWRT_STK_W);  //    over-voltage Threshold (4.2V)
        waitTime(WAIT_2ms);
        WriteReg(0, UV_THRESH, 0x20, 1, FRMWRT_STK_W);  //    under-voltage Threshold (2.8V)
        waitTime(WAIT_2ms);
        WriteReg(0, OVUV_CTRL, 0x04, 1, FRMWRT_STK_W);  //    Setting OVUV_GO value to 1 for starting the OV UV comparator
        waitTime(WAIT_2ms);
    
        WriteReg(0, OTUT_CTRL, 0x04, 1, FRMWRT_STK_W); //       Over and under temp control register
        waitTime(WAIT_2ms);
        WriteReg(0, OTUT_THRESH, 0xFF, 1, FRMWRT_STK_W);  //    over and under temp threshold
        waitTime(WAIT_2ms);
        WriteReg(0, OTUT_CTRL, 0x04, 1, FRMWRT_STK_W);  //    Setting OTUT_GO value to 1 for starting the OT UT comparator
        waitTime(WAIT_2ms);
    
        //set up the main ADC
        WriteReg(0, ACTIVE_CELL, 0x06, 1, FRMWRT_ALL_W);    //set all cells to active (0x0A) // if we want to change the no of cells we will do it here (0x06 for 12 cells).
        waitTime(WAIT_1ms);
        WriteReg(0, ADC_CONF1, 0x02, 1, FRMWRT_ALL_W);      //26Hz LPF_Vcell (38ms average)
        waitTime(WAIT_1ms);
        WriteReg(0, ADC_CTRL1, 0x0E, 1, FRMWRT_ALL_W);      //continuous run, LPF enabled and MAIN_GO
        waitTime(WAIT_35ms+5*TOTALBOARDS);                       //initial delay to allow LPF to average for 38ms (26Hz LPF setting used)
    
    
        //set up temperature
    
    //    WriteReg(0, CONTROL2, 0x01, 1, FRMWRT_STK_W); //to enable the TSREF
    //    waitTime(WAIT_100ms);
    
        ReadReg(0, TSREF_HI, Tref, 2, 0, FRMWRT_ALL_R);
        waitTime(WAIT_2ms);
        uint16 Tref_T = (Tref[0] << 8) | Tref[1];
        //    uint16 Tref_T = (Tref[8+4] << 8) | Tref[8+5];
        printf("\n");
        printf("%f\t",Tref_T*0.00016954);
    

  • Hi Abhaya,

    Try these:

    • Try with each of the 4 boards by themselves
    • Read back the TSREF bit to see if it's being cleared
    • Use the GUI to enable TSREF

    Best regards,
    Barry