Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hello to all, I'm trying to configure the DMA to send data to the SSP1 (mbed SPI pins: 5, 6, 7).
I modified the code from this topic[1] in this way:
#define DMA_CHANNEL_ENABLE 1 #define DMA_TRANSFER_TYPE_M2P (1UL << 11) #define DMA_CHANNEL_TCIE (1UL << 31) #define DMA_CHANNEL_SRC_INC (1UL << 26) #define DMA_MASK_IE (1UL << 14) #define DMA_MASK_ITC (1UL << 15) /* Enable The transmit FIFO for the DMA */ LPC_SSP1->DMACR|=2; /* Power up the GPDMA. */ LPC_SC->PCONP |= (1UL << 29); LPC_GPDMA->DMACConfig = 1; LPC_GPDMA->DMACIntTCClear = 0x1; NVIC_EnableIRQ(DMA_IRQn); /* Prep Channel0 to send 1024 byte to the SSP. */ LPC_GPDMACH0->DMACCSrcAddr = (uint32_t)buffer; LPC_GPDMACH0->DMACCDestAddr = (uint32_t)&LPC_SSP1->DR; LPC_GPDMACH0->DMACCLLI = 0; LPC_GPDMACH0->DMACCControl = DMA_CHANNEL_TCIE | DMA_CHANNEL_SRC_INC | 1024; /* Fire GPDMA Channel0 */ LPC_GPDMACH0->DMACCConfig = DMA_CHANNEL_ENABLE | DMA_TRANSFER_TYPE_M2P | DMA_MASK_IE | DMA_MASK_ITC; extern "C" void DMA_IRQHandler(void) __irq { if (LPC_GPDMA->DMACIntStat & 1) { if (LPC_GPDMA->DMACIntTCStat & 1) { myled3 = 1; LPC_GPDMA->DMACIntTCClear = 1; } if (LPC_GPDMA->DMACIntErrStat & 1) { myled4 = 1; LPC_GPDMA->DMACIntErrClr = 1; } } }But the DMA transfer never start!
Where am I doing wrong?
[1] http://mbed.org/forum/mbed/topic/1138/?page=1#comment-5543