cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure SPI on STM32F103?

quentin239955_stm1
Associate II
Posted on May 23, 2012 at 11:52

Hi,

I am trying to use the OLIMEX STM32-P103 (ARM cortex M3) as SPI master to get some information from an accelerometer but, I dont know how to use SPI. Even after many hours of searching on the internet i did not found any examples or tutorial. Can someone help me by giving me links or explaining me?

Thanks

PS: I am using IAR workbench for ARM.

      Please excuse me for my bad english.

#spi-stm32f103
11 REPLIES 11
quentin239955_stm1
Associate II
Posted on May 24, 2012 at 15:59

I

completely

rebuilt

the program

,

I decided

to use

simplex

with only

reception

.

But it

still does not work

.

The library

for

what

I do not find

are

SPI

function

with

the description

of

how to

declare them,

prototype

with their

arguments

and their

posible arguments

.

The

type of document

that we have

generally

paper or

in PDF

.

Here

is

my main

.

________________

Attachments :

main.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I003&d=%2Fa%2F0X0000000bRx%2FhQCKq_bLVUT2UckBW241rOXBke8lNnNeD623S9Ls.zs&asPdf=false
frankmeyer9
Associate II
Posted on May 24, 2012 at 17:04

The stm32f4_discovery should have some SPI examples, it features a similiar sensor, the LIS302DL. Again, you will need to make some adjustments to get it running on the F10x, or you can compare the code there with your implementation.

Getting such things to work from scratch is time consuming, but there is hardly a way around.

I hope you can get hold of a scope, otherwise it gets really  difficult...