cancel
Showing results for 
Search instead for 
Did you mean: 

Severe problems for SPI in slave mode

kenn
Associate II
Posted on October 27, 2010 at 15:15

Severe problems for SPI in slave mode

2 REPLIES 2
aqueisser
Senior
Posted on May 17, 2011 at 14:13

Wow, sounds crazy!

I've got SPI working in slave mode (tried SPI2 and SPI3 on F103ZD on the 3210E-EVAL.) at 1-2MHz. I'm using AF_PP on the MISO pin.

Looking at your description, if it's not noise then it might be a power problem. Not sure how the Discovery and Primer are powered but maybe something is marginal. What's the load on the MISO pin when you don't have a pullup?

Some things you may have tried already:

- Reverse the MSB/LSB order, how do the flipped bits change? Do they move from the bottom of the byte to the top?

- Hook up a STM master SPI to a STM slave SPI on the same part (if electrically possible)

Andrew

kenn
Associate II
Posted on May 17, 2011 at 14:13

In regards to the load on the MISO pin, the input impedance on the arduino is in the several MOhms range, so I shouldn't expect that this would be the problem.

I have hooked up the SPI2 to SPI1 and got somewhat more reliable communication, although I cannot for the life of me determine where the problem is coming from. Since the Arduino is in floating mode, the  only thing that comes to mind is that maybe the very slight capacitance at 5V on the floating input causes a problem with the MISO.

This post, https://my.st.com/public/STe2ecommunities/mcu/Lists/ARM%20CortexM3%20STM32/Flat.aspx?RootFolder=https%3a%2f%2fmy%2est%2ecom%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fARM%20CortexM3%20STM32%2fSPI%2dSlave%20%2d%20data%20corruption%20using%20Full%20Duplex%20communication&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000626BE2B829C32145B9EB5739142DC17E&currentviews=249,  seems to confirm some of my problems.

So since this particular poster never had a satisfying resolution, nor response from STM for that matter, so I don't expect much resolution here, either, except not to use SPI in slave mode. It seems that there are many complaints about errata for the SPI port.