cancel
Showing results for 
Search instead for 
Did you mean: 

How to output CLK for receive-only (master) in SPI communication

pass3master
Senior

How to output CLK for receive-only (master) in SPI communication
We want to create a receive-only (master) in SPI communication.
However, SPI_CLK is not generated.
In the case of a transmit-only (master), I think that CLK will be generated if CLK is enabled when transmitting with HAL_SPI_TransmitReceive,
but in the case of a receive-only (master), how do you output CLK?
Will CLK be generated automatically if I call HAL_SPI_Receive?

2 REPLIES 2
PGump.1
Senior III

Hi,

SPI is full-duplex. Except for a couple of odd single wire modes.

I don't use HAL. However, HAL_SPI_TransmitReceive() is the function you need to use...

Kind regards
Pedro

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.

This has already been answered:

https://community.st.com/t5/stm32-mcus-products/question-about-the-spi-communication-clock/td-p/736863

https://community.st.com/t5/stm32-mcus-products/how-to-perform-spi-communication-within-a-board-master-and-slave/td-p/736869

 

HAL_SPI_Receive() exists.

See also:

https://community.st.com/t5/stm32-mcus-embedded-software/hal-spi-receive-it-also-transmits/m-p/737631/highlight/true#M56509

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.