The chip-selected pin goes high even set low during SPI transition
Hello Group,
I am reading SPI from the Nucleo STM#@F401RE with the ST accelerometer LIS2DW12. I set the chip-selected pin low during the transition, but I saw the selected pin go high.
How I fix this problem?
Thanks a lot for your time,
Jack
void readId()
{
uint8_t bufp[1];
uint8_t reg = LIS2DW12_WHO_AM_I;
reg |= 0x80;
HAL_GPIO_WritePin(CS_up_GPIO_Port, CS_up_Pin, GPIO_PIN_RESET);
HAL_SPI_Transmit(&hspi2, ®, 1, 1000);
HAL_SPI_Receive(&hspi2, bufp, 1, 1000);
HAL_GPIO_WritePin(CS_up_GPIO_Port, CS_up_Pin, GPIO_PIN_SET);
}

