Hi TI Team,
Currently i am working on BQ79656-Q1 BMS IC. I read the 16 cell voltage with my host controller from BQ IC. Now i want to use the BQ IC GPIO1 OT GPIO5 pin to read adc value. 5 volt is present at TSREF pin. I configure the below setting:-
uint8_t Tx_Buffer[7]={0x90,0x00,0x03,0x0A,0X01,0XD3,0X7D};//WRITE uart string to ON THE TREFERENCE of BQ IC
Wake79616();
mSDelay(12*TOTALBOARDS); //wake tone duration is ~1.6ms per board + 10ms per board for each device to wake up from shutdown = 11.6ms per 616 board (rounded to 12ms since variable used is an integer)
Wake79616();
mSDelay(12*TOTALBOARDS); //wake tone duration is ~1.6ms per board + 10ms per board for each device to wake up from shutdown = 11.6ms per 616 board (rounded to 12ms since variable used is an integer)
AutoAddress();//ADDRESS IS ASSIGN TO BQ IC.IF 1 IC THEN ASSIGN ADDRESS=5.
uSDelay(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//broadcast WRITE
ResetAllFaults(0, FRMWRT_ALL_W); //CLEAR ALL FAULTS//broadcast WRITE
R_UART1_Send(Tx_Buffer,7);//WRITE uart string to ON THE TREFERENCE of BQ IC
mSDelay(2);//necessary 1.35ms delay before sending another command to enable TREFERENCE of BQ IC
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, 0x06, 1, FRMWRT_ALL_W); //continuous run, LPF enabled and MAIN_GO
uSDelay(38000+5*TOTALBOARDS); //initial delay to allow LPF to average for 38ms (26Hz LPF setting used)
WriteReg(0, GPIO_CONF1, 0x02, 1, FRMWRT_ALL_W);//GPIO1 AS ADC FOR READ NTC TEMPERATURE
WriteReg(0, ADC_CTRL3, 0x06, 1, FRMWRT_ALL_W); //ADC continuous run
But i am unable to read the GPIO1 ADC value by sending the command as mentioned below:-
while(1)
{
//wait single round robin cycle time + reclocking delay for each device, every loop
uSDelay(192+5*TOTALBOARDS);
//READ THE NTC TEMPERATURE(GPIO1)
ReadReg(0, /*AUX_GPIO_HI*/GPIO1_HI, response_frame3, 1*2, 1000, FRMWRT_SGL_R);
//format and print the resultant response frame
//convert the two individual bytes of into a single 16 bit data item (by bit shifting)
ADCDataFromBQ1 = (response_frame3[4] << 8) | response_frame3[5];
mSDelay(100);
uint8_t Tx_Buffer[7]={0x90,0x00,0x03,0x0A,0X01,0XD3,0X7D};//WRITE uart string to ON THE TREFERENCE of BQ IC Wake79616(); mSDelay(12*TOTALBOARDS); //wake tone duration is ~1.6ms per board + 10ms per board for each device to wake up from shutdown = 11.6ms per 616 board (rounded to 12ms since variable used is an integer) Wake79616(); mSDelay(12*TOTALBOARDS); //wake tone duration is ~1.6ms per board + 10ms per board for each device to wake up from shutdown = 11.6ms per 616 board (rounded to 12ms since variable used is an integer) AutoAddress();//ADDRESS IS ASSIGN TO BQ IC.IF 1 IC THEN ASSIGN ADDRESS=5. uSDelay(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//broadcast WRITE ResetAllFaults(0, FRMWRT_ALL_W); //CLEAR ALL FAULTS//broadcast WRITE R_UART1_Send(Tx_Buffer,7);//WRITE uart string to ON THE TREFERENCE of BQ IC mSDelay(2);//necessary 1.35ms delay before sending another command to enable TREFERENCE of BQ IC 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, 0x06, 1, FRMWRT_ALL_W); //continuous run, LPF enabled and MAIN_GO uSDelay(38000+5*TOTALBOARDS); //initial delay to allow LPF to average for 38ms (26Hz LPF setting used) WriteReg(0, GPIO_CONF1, 0x02, 1, FRMWRT_ALL_W);//GPIO1 AS ADC FOR READ NTC TEMPERATURE mSDelay(2); while(1) { //wait single round robin cycle time + reclocking delay for each device, every loop uSDelay(192+5*TOTALBOARDS); //READ THE NTC TEMPERATURE(GPIO1) ReadReg(0, /*AUX_GPIO_HI*/GPIO1_HI, response_frame3, 1*2, 1000, FRMWRT_SGL_R); //format and print the resultant response frame //convert the two individual bytes of into a single 16 bit data item (by bit shifting) ADCDataFromBQ1 = (response_frame3[4] << 8) | response_frame3[5]; mSDelay(100); }
}
Please help me to resolve this issue.
Thanks with Regards,
DEEPAK