Hi,
I am trying to interface BQ79606EVM with MSP432 mC. I was able to wake up the BQ79606EVM using the WAKEUP PIN by sending signal on the GPIO pin of MSP432.
However, I am unable to read a register from BQ79606. In the mC, I am using 12Mhz and have set UART with Baud rate of 1Mhz. I have been sending the single device read code to fetch the information.
Kindly advise.
Here are the code snippets I have used-
a) MSP432 BRS settings parameter for clk source 12MHz and Baud rate 1 Mhz-
const eUSCI_UART_ConfigV1 uartConfig =
{
EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
12, // BRDIV = 78
0, // UCxBRF = 2
0, // UCxBRS = 0
EUSCI_A_UART_NO_PARITY, // No Parity
EUSCI_A_UART_LSB_FIRST, // LSB First
EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
EUSCI_A_UART_MODE, // UART mode
EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION, // Oversampling
EUSCI_A_UART_8_BIT_LEN // 8 bit data length
};
b) Read VCELLH register - Directly sending the hex values through UART to BQ79606
unsigned char comm_frame[7] = {0x80,0x00,0x02,0x15,0x01,0xCB,0x49};
//loop to send all the 7 hex values
while(i_loop < 7)
{
while( !(UCA2IFG & UCTXIFG) );
EUSCI_A_CMSIS(EUSCI_A2_BASE)->TXBUF = comm_frame[i_loop];
i_loop++;
}
//delay code comes here
//another loop written to receive values in a buffer
while( !(UCRXIFG) );
*resp_ptr = EUSCI_A_CMSIS(EUSCI_A2_BASE)->RXBUF;
Regards,
Navin