Hi forum,
I’m configuring the DMA for transferring data from memory to the SSP(1) peripheral, on an LPC1768.
I do the following steps:
-
Enable PCONP (bit 29)
-
Clear(reset) configurations for all DMA channels config (DMACCConfig) and control (DMACCConfig) registers
-
Clear all DMA interrupts and error flags
-
Clear linked list for desired channel
-
Specify DMACCSrcAddr
-
Specify DMACCDestAddr (with 0x40030008 which is the SSP1 Data Register address)
-
Configure the DMACCxControl register to values:
SBSize = 001 (4 bytes)
DBSize = 001 (4 bytes)
SWidth = 000 - Byte (8-bit)
DWidth = 000 - Byte (8-bit)
SI = 1 (source increment)
DI = 0 (destination increment)
I = 1 (Terminal count interrupt enable bit)
-
Enable GPDMA globally (LPC_GPDMA->DMACConfig) and wait for enable to take effect
-
Configure the DMACCxConfig register to values:
E = 0 (channel is enabled later)
SrcPeripheral =0 (ignored)
DestPeripheral = 2 (SSP1 TX)
Transfer type = 001 (mem to peripheral)
IE = 1
ITC = 1
After that I specify the source memory address, the length in bytes for the transfer and finally I give the following commands
LPC_SSP1->DMACR = SSP_DMA_TX;
channel[TX]->DMACCConfig |= GPDMA_DMACCxConfig_E;
For some reason this procedure is not taking any effect at all…
Any information is highly valuable and appreciated
Thanks in advance,
RM