cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303 SPI clock in read processing

kenji
Associate
Posted on November 10, 2016 at 06:14

I have question about SPI communication on the STM32F303.

Read processing from slave device(SD) in SPI does not go well. I expected that 1 is returned, but 0 is returned.

I check program code and signal by oscilloscope. When the read access to data register(DR) is performed,  the clock signal from SCK was not output.

When the write access to DR is performed, the clock signal was output. So I think clock is output when read access.

Is this recognition a correct?

If it is correct, what will be considered as a cause?

If it is not correct, when will a signal occur in program control?

Before doing read access, I confirm that SPI_FLAG_RXNE flag is set.

#stm32
2 REPLIES 2
slimen
Senior
Posted on November 25, 2016 at 12:42

Hello,

You can refer to the reference manual RM0316 for more clarification about SPI communication.

Regards

alkuor
Associate II
Posted on November 30, 2016 at 07:06

You have to send a dumb (0xff) to the slave after sending your command to be able to receive data from slave without sending any data SCLK will be low.