cancel
Showing results for 
Search instead for 
Did you mean: 

SPI function of STM32F746 to perform half-duplex communication

勝後藤.1
Associate II

Hello,

Is it possible to realize bidirectional communication using one data line (SDA signal) in the figure by using the SPI function of STM32F746 to perform half-duplex communication (a method of controlling and switching the RXONLY bit)?

Like exsample1 and exsample2 in the figure, it is necessary to switch to immediate reception after 9-bit transmission, 9-bit transmission, and reception after passing through a 1-bit dummy.

Is it possible to switch between sending and receiving in this way?

If possible, can you tell me if there are any things you need to be careful about in connection, clock control and register settings?​

Goto​

3 REPLIES 3
KnarfB
Principal III

If the peripheral chip is ready for that, it is possible. There is a SPI Half-duplex communication chapter in the reference manual. It is sometimes called "3-wire SPI"

勝後藤.1
Associate II

Please tell me the specific control method.

Is it possible to switch to reception by setting the BDIOE bit of SPIx_CR1 registers to 0: Output disabled (receive-only mode)?

For exsample1, if the sequence is as follows, does the clock signal automatically become High after the processing of 1 is completed?

After that, in the process of 2, does STM32 immediately start transmitting the clock and receive the data?

sequence

1. 9-bit transmission completed

2. Set BDIOE bit to 0

3. Receive 8-bit

For exsample2, can STM32 receive data in the following sequence?

In that case, is it possible to prevent STM32 from receiving the data for one bit of the dummy clock cycle?

Or is it better to send 10 bits in process 1?

sequence

1. 9-bit transmission completed

2. Set BDIOE bit to 0

3. Repeat 8-bit reception 3 times

Goto​

Please tell me the specific control method. Is it possible to switch to reception by setting the BDIOE bit of SPIx_CR1 registers to 0: Output disabled (receive-only mode)? For exsample1, if the sequence is as follows, does the clock signal automatically become High after the processing of 1 is completed? After that, in the process of 2, does STM32 immediately start transmitting the clock and receive the data? sequence 1. 9-bit transmission completed 2. Set BDIOE bit to 0 3. Receive 8-bit For exsample2, can STM32 receive data in the following sequence? In that case, is it possible to prevent STM32 from receiving the data for one bit of the dummy clock cycle? Or is it better to send 10 bits in process 1? sequence 1. 9-bit transmission completed 2. Set BDIOE bit to 0 3. Repeat 8-bit reception 3 times Goto 2021年3月3日(水) 15:35 ST Community :