SPI PORT

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
scrikt
Posts: 13
Joined: Wed Jun 05, 2013 1:14 pm

SPI PORT

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SPI PORT

Post 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
scrikt
Posts: 13
Joined: Wed Jun 05, 2013 1:14 pm

Re: SPI PORT

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SPI PORT

Post 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
scrikt
Posts: 13
Joined: Wed Jun 05, 2013 1:14 pm

Re: SPI PORT

Post by scrikt »

in what way?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SPI PORT

Post by Giovanni »

It all depends on what you want to accomplish. This forum is for support, explain your case if you need help.

Giovanni
scrikt
Posts: 13
Joined: Wed Jun 05, 2013 1:14 pm

Re: SPI PORT

Post by scrikt »

I would like to send as a number and receive a number incremented by one unit.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SPI PORT

Post 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
scrikt
Posts: 13
Joined: Wed Jun 05, 2013 1:14 pm

Re: SPI PORT

Post by scrikt »

it is an exercise, but I was asked through the use of SPI and I wanted some examples to understand.
Post Reply