cancel
Showing results for 
Search instead for 
Did you mean: 

SPI not working on STM3210E-EvalBorad

saurabh23
Associate II
Posted on April 08, 2011 at 14:15

SPI not working on STM3210E-EvalBorad

2 REPLIES 2
leszek2
Associate II
Posted on May 17, 2011 at 14:31

Show us the the read process code. I think that maybe you (after sending cmd by spi) dont do dummy read of DR spi buffer,

for ex:

check flag in SPI->SR is data sent (0x01 or 0x02 I dont remember)

send: SPI->DR = cmd;

check flag in SPI->SR is data received (0x01 or 0x02 the same)

receive dummy: dummy = SPI->DR;

then you do the same, check sr for sent data, send dummy data to force clk on spi pin, check for data received flag in SR and if so, read data from DR.

and so on. Maybe thats why uC stops sending even the clock. Check it out ;]

saurabh23
Associate II
Posted on May 17, 2011 at 14:31

I could get the read/write to work by reducing the SPI speed to 281KHz. Somehow SPI is not working at speeds in MHz