Reply by Tim Mitchell January 17, 20122012-01-17
Just for the archives, I eventually found the solution to my SSP/DMA problem.

In the SSP1DMACR register I had only enabled the transmit side for DMA (as the return data is just dummy data I do not need). But! you have to enable both transmit and receive for DMA operation by setting the register to 3, otherwise it doesn't work. This does not appear to be documented anywhere and I only tried it out of desperation...
--
Tim Mitchell

An Engineer's Guide to the LPC2100 Series

Reply by "M. Manca" January 11, 20122012-01-11
Il 11/01/2012 12:49, Tim Mitchell ha scritto:
>
>
> Hi folks
> I am trying to get SSP transmit working with DMA on an LPC1754.
> I just want to send a block of 512 bytes out of the SSP1. The SSP1
> works in itself if I write to it manually or using the SSP interrupt,
> however if I use DMA then nothing comes out of it at all and the DMA
> interrupt never fires.
>
> The source buffer OutputBuf[] is in USB RAM, though I am not sure this
> is necessary in the LPC17xx (it was in the LPC2xxx as DMA couldn't
> access the normal ram)
>
LPC17xx can access all ram banks. You need to setup DMA to work doing
that SSP controls the flow of data through DMA (if I remember well it is
mode 6).
> Can anyone spot my error?
>
> //set up DMA
> PCONP|=PCONP_PCGPDMA;
> DMACConfig=0x01;
> NVIC_SetPriority(DMA_IRQn,0x0A);
>
> DMACIntTCClear = 0xFF;
> DMACIntErrClr = 0xFF;
>
> DMACC1SrcAddr=(unsigned int)&OutputBuf[0];
> DMACC1DestAddr=(unsigned int)&SSP1DR;
> DMACC1Control=0x200|(1<<12)|(1<<15)|(2<<18)|(2<<21)|(1<<26)|(0<<27)|(1<<31);
> //set transfersize, and burst width as 4 bytes, enable source inc,
> enable TC int
> DMACC1Config=(0<<1)|(2<<6)|(1<<11)|(1<<14)|(1<<15); //set src to mem,
> dest to ssp1tx, transfer type to M2P, enable tc int
> DMACC1LLI=0;
>
> SSP1DMACR=1; //enable SSP to use dma on tx
>
> NVIC_EnableIRQ(DMA_IRQn);
>
> DMACC1Config|=1; //enable the channel
> --
> Tim Mitchell



Reply by Tim Mitchell January 11, 20122012-01-11
Hi folks
I am trying to get SSP transmit working with DMA on an LPC1754.
I just want to send a block of 512 bytes out of the SSP1. The SSP1 works in itself if I write to it manually or using the SSP interrupt, however if I use DMA then nothing comes out of it at all and the DMA interrupt never fires.

The source buffer OutputBuf[] is in USB RAM, though I am not sure this is necessary in the LPC17xx (it was in the LPC2xxx as DMA couldn't access the normal ram)

Can anyone spot my error?

//set up DMA
PCONP|=PCONP_PCGPDMA;
DMACConfig=0x01;
NVIC_SetPriority(DMA_IRQn,0x0A);

DMACIntTCClear = 0xFF;
DMACIntErrClr = 0xFF;

DMACC1SrcAddr=(unsigned int)&OutputBuf[0];
DMACC1DestAddr=(unsigned int)&SSP1DR;
DMACC1Control=0x200|(1<<12)|(1<<15)|(2<<18)|(2<<21)|(1<<26)|(0<<27)|(1<<31); //set transfersize, and burst width as 4 bytes, enable source inc, enable TC int
DMACC1Config=(0<<1)|(2<<6)|(1<<11)|(1<<14)|(1<<15); //set src to mem, dest to ssp1tx, transfer type to M2P, enable tc int
DMACC1LLI=0;

SSP1DMACR=1; //enable SSP to use dma on tx

NVIC_EnableIRQ(DMA_IRQn);

DMACC1Config|=1; //enable the channel
--
Tim Mitchell