Skip to main content
勝後藤.1
Associate II
Mar 8, 2021 12:04 AM UTC
Solved

SPI function of STM32F746 to perform half-duplex communication�?2

Hello,

As described in the reference manual of STM32F746, it was found that bidirectional communication using one data line (SDA signal) in the figure can be realized by performing half-duplex communication using the SPI function.

​

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​

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Mar 8, 2021 7:48 AM UTC

If you transmit 9 bit frame, you will also receive 9 bit frames. So you will need to reprogram also the frame length, and I am not sure if you can do it without disabling/enabling SPI.

Rx in bidirectional mode is tricky also because as soon as you turn direction to Rx, SPI automatically starts to generate clocks and will stop only when you turn back direction to Tx.

JW

1 reply

waclawek.jan
waclawek.janBest answer
Super User
Mar 8, 2021 7:48 AM UTC

If you transmit 9 bit frame, you will also receive 9 bit frames. So you will need to reprogram also the frame length, and I am not sure if you can do it without disabling/enabling SPI.

Rx in bidirectional mode is tricky also because as soon as you turn direction to Rx, SPI automatically starts to generate clocks and will stop only when you turn back direction to Tx.

JW