Page 1 of 1

SPI PORT

Posted: Sat Jun 08, 2013 2:00 pm
by scrikt
hi I have to program the SPI port, I wanted to know where to find documentation for the CR1 and CR2 Records, thanks to all

Re: SPI PORT

Posted: Sat Jun 08, 2013 3:29 pm
by Giovanni
The definitions are in the ST-provided file stm32f30x.h, you also need to read the STM32F30x Reference Manual in order to make meaningful settings.

Giovanni

Re: SPI PORT

Posted: Sat Jun 08, 2013 5:50 pm
by scrikt
thank you, I found what I need, I'm trying to figure out what exactly does the demo spi, can you explain me?
I'm trying to configure a spi as master and transmit information and then receive it on a slave, process it and send it back.
I want to do everything on stm32f3 iPADB setting as master and as slave PADC.

Re: SPI PORT

Posted: Sat Jun 08, 2013 6:06 pm
by Giovanni
Slave mode is not supported by the SPI driver. SPI is mostly used to interface peripherals, you could do that using the serial driver if you wish.

Giovanni

Re: SPI PORT

Posted: Sat Jun 08, 2013 6:11 pm
by scrikt
in what way?

Re: SPI PORT

Posted: Sat Jun 08, 2013 6:16 pm
by Giovanni
It all depends on what you want to accomplish. This forum is for support, explain your case if you need help.

Giovanni

Re: SPI PORT

Posted: Sat Jun 08, 2013 6:19 pm
by scrikt
I would like to send as a number and receive a number incremented by one unit.

Re: SPI PORT

Posted: Sat Jun 08, 2013 6:34 pm
by Giovanni
On the same board?

You may connect two USARTs together, let's say A and B, then connect A-RX with B-TX and viceversa. Then you can use the Serial driver API to exchange data, for example using two threads, the first thread send the number through A, the second receives it through B and sends it back increased, then A receives the result.

Of course there are a lot of details to be filled in (choosing USARTs, setting up pins, enabling the drivers and so on) but I imagine you are doing it as an exercise so I will not help.

Giovanni

Re: SPI PORT

Posted: Sat Jun 08, 2013 6:42 pm
by scrikt
it is an exercise, but I was asked through the use of SPI and I wanted some examples to understand.