cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_SPI SPI_DIRECTION_1LINE mode Send 4 more cycles

xhan.11
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

2 REPLIES 2
TDK
Guru

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".

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