cancel
Showing results for 
Search instead for 
Did you mean: 

spi2 and dma

michaldemin2
Associate II
Posted on January 17, 2010 at 12:32

spi2 and dma

3 REPLIES 3
michaldemin2
Associate II
Posted on May 17, 2011 at 13:38

Hello

I have created set of functions to initialize and use SPI1 channel with DMA.

I have tried to expand it to be able to use SPI2 also. But I'm not getting any DMA interrupts for SPI2 channel.

Does SPI2 differ from SPI1? Did I miss something in the Datasheet ?

I'm attaching the code as spi.txt

16-32micros
Associate III
Posted on May 17, 2011 at 13:38

Hi,

The mistake is here :

Quote:

// SPI module enable

if (SPI == SPI1) {

RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);

} else {

RCC_APB2PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE);

SPI2 is connected to APB1 not APB2 , so you should modify the second line to

RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE);

hope this helps you :)

STOne-32.

michaldemin2
Associate II
Posted on May 17, 2011 at 13:38

Thanks a lot. I have fixed it few hours earlier ;)