Other Parts Discussed in Thread: BQ79616
I have bq79616EVM board which I am trying to interface with a microcontroller through UART.
I am following the procedure given in datasheet as follows:
First a wake pulse of 2.5ms is sent which successfully wakes up the board.
The current consumption is slightly increased and the on-board LED lights up.
Then I am sending auto addressing commands and at the end wait for a response from the board. The problem is I am not getting any responses from the board.
/* Initialize for UART_PAL */ UART_Init(&uart_instance, UART_PAL_CONFIG); uint8_t cmd[] = {0xD0, 0x03, 0x4c, 0x00, 0xFC, 0x24}; uint8_t cmdSetAutoAdd[] = {0xD0, 0x03, 0x09, 0x01, 0x0F, 0x74}; uint8_t cmdSetAdd[] = {0xD0, 0x03, 0x06, 0x00, 0xCB, 0x44}; uint8_t cmdSetStack[] = {0xD0, 0x03, 0x08, 0x02, 0x4e, 0xe5}; uint8_t cmdSetBase[] = {0xD0, 0x03, 0x08, 0x01, 0x0e, 0xe4}; // uint8_t cmd1[] = {0xC0, 0x05, 0x68, 0x10, 0x02, 0x29}; uint8_t cmd1[] = {0xC0, 0x03, 0x4c, 0x1, 0x39, 0x24}; UART_SendDataBlocking(&uart_instance, (uint8_t *) cmd, 6, TIMEOUT); while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY); UART_SendDataBlocking(&uart_instance, (uint8_t *) cmdSetAutoAdd, 6, TIMEOUT); while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY); UART_SendDataBlocking(&uart_instance, (uint8_t *) cmdSetAdd, 6, TIMEOUT); while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY); UART_SendDataBlocking(&uart_instance, (uint8_t *) cmdSetStack, 6, TIMEOUT); while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY); UART_SendDataBlocking(&uart_instance, (uint8_t *) cmdSetBase, 6, TIMEOUT); while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY); UART_SendDataBlocking(&uart_instance, (uint8_t *) cmd1, 6, TIMEOUT); while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY); while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY); /* Send a welcome message */ // UART_SendDataBlocking(&uart_instance, (uint8_t *)welcomeMsg, strlen(welcomeMsg), TIMEOUT); /* Infinite loop: * - Receive data from user * - Echo the received data back */ while(1) { /* Receive and store data byte by byte until new line character is received, * or the buffer becomes full (256 characters received) */ UART_ReceiveData(&uart_instance, buffer, 1U); /* Wait for transfer to be completed */ while(UART_GetReceiveStatus(&uart_instance, &bytesRemaining) == STATUS_BUSY); }
the code is stuck at UART_GetReceiveStatus, i dont receive anything from EVM board, for safety i tested this code with terminal software and i can see the baud rate is 1mbps and data received is correct also i send back data from terminal i receive same data in firmware end.
I dont have doubt on firmware part if some sequence is missing or crc error in packet.
is there something that is missing in code? what is led state meaning on EVM ? its in active mode right ?