2010-01-17 03:32 AM
spi2 and dma
2011-05-17 04:38 AM
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.txt2011-05-17 04:38 AM
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.2011-05-17 04:38 AM
Thanks a lot. I have fixed it few hours earlier ;)