Skip to main content
rozehtiyan
Associate III
July 15, 2014
Question

SPI doesn't work! & How to configure the Baud Rate Perscaler?

  • July 15, 2014
  • 12 replies
  • 1337 views
Posted on July 15, 2014 at 13:20

SPI doesn't work! & How to configure the Baud Rate Perscaler?

#spi-stm32f103 #stm32f030f4
This topic has been closed for replies.

12 replies

DiBosco
Senior
July 15, 2014
Posted on July 15, 2014 at 13:27

When you say it doesn't work, what, exactly, doesn't work? For example, are you seeing a clock on the clock line with your scope?

Tesla DeLorean
Guru
July 15, 2014
Posted on July 15, 2014 at 13:39

Probably want to ensure the buffer is NUL terminated, before using string functions.

Try debugging the send end first, using a scope or analyzer.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
rozehtiyan
Associate III
July 15, 2014
Posted on July 15, 2014 at 14:18

@wood.robert There is a LED that I connected to

GPIOB

0 (stm32f103) that it doesn't work. it should be turn on when the SPI1 peripheral get the

''Rohalamin''

string. @clive1 My Saleae logic shows me this:

http://s1.uploads.im/UMHsJ.jpg

http://s1.uploads.im/RlIt0.jpg

Tesla DeLorean
Guru
July 15, 2014
Posted on July 15, 2014 at 16:00

Perhaps you might want to use the Standard Firmware Library, and not the HAL/CUBE stuff, I don't see any code initializing the pins properly in your F030 example. Probably save you several man-days of effort messing around with the problem.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
rozehtiyan
Associate III
July 16, 2014
Posted on July 16, 2014 at 19:28

I changed the codes. Is there any ST E-Mail? I want to send an E-Mail to them and ask my question.

Tesla DeLorean
Guru
July 16, 2014
Posted on July 16, 2014 at 19:45

Push in via your local account rep, or FAE

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
rozehtiyan
Associate III
July 17, 2014
Posted on July 17, 2014 at 05:53

How exactly? What should I do?

rozehtiyan
Associate III
July 17, 2014
Posted on July 17, 2014 at 10:33

I changed the codes and Now they work better! the first problem was that I forgotten to high and low the NSS pin. I changed the code and now it works better than before. as you can see in Saleae, the data is odd (in other word, it's not ''Rohalamin'').

http://i.stack.imgur.com/PUOFk.jpg

Tesla DeLorean
Guru
July 17, 2014
Posted on July 17, 2014 at 18:02

How exactly? What should I do?

How important is your problem?

/st-extranet-web-active/active/en/support/online_support.html

http://www.st.com/stonline/contactus/contacts/index.php?type=2

/st-extranet-web-active/active/en/support/mcu_design_consultants.html

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
rozehtiyan
Associate III
July 22, 2014
Posted on July 22, 2014 at 18:42

How much working with the SPI is important?

as you can see, that's really important.