Skip to main content
xhan.11
Associate II
Dec 27, 2021 3:15 AM UTC
Solved

HAL_SPI SPI_DIRECTION_1LINE mode Send 4 more cycles

HI:

STM32F103

STM32CUBEMX V4.25.1

As shown in the figure, I read one byte in 1line mode, but sent five bytes, four more than I wanted.

0693W00000HppB5QAJ.jpgthanks

This topic has been closed for replies.
TDK
TDKBest answer
Dec 27, 2021 4:07 AM UTC

That's just how the hardware works in one line receive mode. The clock continues until the peripheral is disabled which takes some time, particularly at high data rates.

You can use two line mode, or use your own drivers to control the peripheral more exactly.

0693W00000HppDzQAJ.png 

"If you feel a post has answered your question, please click ""Accept as Solution""."

2 replies

TDK
TDKBest answer
Dec 27, 2021 4:07 AM UTC

That's just how the hardware works in one line receive mode. The clock continues until the peripheral is disabled which takes some time, particularly at high data rates.

You can use two line mode, or use your own drivers to control the peripheral more exactly.

0693W00000HppDzQAJ.png 

"If you feel a post has answered your question, please click ""Accept as Solution""."
xhan.11
xhan.11Author
Associate II
Dec 27, 2021 8:07 AM UTC

Thank you for your reply, which solves my problem. Unfortunately, I have to use single line mode.