SPI PORT
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: SPI PORT
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
Giovanni
Re: SPI PORT
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.
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.
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: SPI PORT
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
Giovanni
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: SPI PORT
It all depends on what you want to accomplish. This forum is for support, explain your case if you need help.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: SPI PORT
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
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
it is an exercise, but I was asked through the use of SPI and I wanted some examples to understand.