2021-08-11 01:47 AM
// CS pin go low to select
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET);
HAL_SPI_Transmit(&hspi1, (uint8_t *)spi_buf, 3, 10);
// CS pin go high to release
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET);
I use the above code to communicate with a device through SPI.
The green line D10 in the above picture is chip select (CS) signal. The gap between CS-enable and clock start is about 13 us, so is that between clock stop and CS-disable. It's too much waste of time. Anyone knows how to reduce it?
2021-08-11 02:08 AM
Hope this helps,
Danish
2021-08-11 08:38 PM