cancel
Showing results for 
Search instead for 
Did you mean: 

SPI from AEK-POW-BMSWTX

IPrin.1
Associate III

Hi

I am trying to use the AEK-POW-BMSWTX to read cell voltages from an Optipower OPR50006S50 Lithium Ion battery.  I only want the cell information, not interested in battery management itself.  I'm using SPI2 from an STM32G474RE.

I have spliced pin C0 to the GND EXT pins and the GND terminal of the battery, then used C1 through C6 for cell wires. C6 is spliced to C7 through to C14, finally the positive terminal of the battery is connected to VBAT.

IPrin1_0-1776237586280.png

The issue I am finding despite no MISO comms from the board is LED D2 goes off after 60 or so seconds.

My SPI function is as below:

void BMS_Read(uint8_t *rxBuf, uint16_t len)

{

uint8_t wake[5] = {0x55,0x55,0x55,0x55,0x55};

uint8_t rxBuf[8];

HAL_GPIO_WritePin(SPI2_BMS_CS_GPIO_Port, SPI2_BMS_CS_Pin, GPIO_PIN_RESET);

HAL_SPI_Transmit(&hspi2, wake, 5, HAL_MAX_DELAY);

for (uint16_t i = 0; i < len; i++)

{

uint8_t dummy = 0xFF;

HAL_SPI_TransmitReceive(

&hspi2,

&dummy, // generate clock

&rxBuf[i], // read MISO

1,

HAL_MAX_DELAY

);

}

HAL_GPIO_WritePin(SPI2_BMS_CS_GPIO_Port, SPI2_BMS_CS_Pin, GPIO_PIN_SET);

HAL_Delay(2);

}

Scoping this suggests the MOSI side is working as expected.  However there is no response on MISO and the LED D2 goes off.

Thanks in advance for any suggestions

 

2 REPLIES 2
KDJEM.1
ST Employee

Hello @IPrin.1 ;

 

I advise you to consult the AEK-POW-BMSWTX documentation for LED D2 status meaning. 

Could you please double check all the wiring and SPI settings.

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Pavel A.
Super User

Maybe you need to raise CS after the wake sequence and lower CS again before the HAL_SPI_TransmitReceive loop? or add delay after the wake sequence?