DMA driving SSP on LPC1768

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:

  1. Enable PCONP (bit 29)

  2. Clear(reset) configurations for all DMA channels config (DMACCConfig) and control (DMACCConfig) registers

  3. Clear all DMA interrupts and error flags

  4. Clear linked list for desired channel

  5. Specify DMACCSrcAddr

  6. Specify DMACCDestAddr (with 0x40030008 which is the SSP1 Data Register address)

  7. 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)

  1. Enable GPDMA globally (LPC_GPDMA->DMACConfig) and wait for enable to take effect

  2. 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

Take a look at this driver I wrote based on the NXP driver library (but with some bugs fixed and some additional features), it may help you (and make your life easier):-

http://mbed.org/users/AjK/libraries/MODDMA/latest