Content originally posted in LPCWare by Rob65 on Wed Aug 17 23:42:56 MST 2011
Wade,
NXP is known to answer posts frequently, but sometimes they new a bit of time to figure out what the correct answer is.
There is however no guarantee that they will see, or answer, to your question. Whitecoe is right in stating this is a user forum but both NXP and Code Red are known to give support on their products via this medium.
having said this, what is your progress with your questions?
Did you test the code you posted?
I have used the same scatter/gather DMA engine on other NXP products but not (yet) on the lpc1xxx devices.
A scatter/gather linked list works on one DMA channel and a DMA channel is programmed to have either memory or a peripheral as source or destination.
In the DMACConfig register you program the type of transaction (memory-memory, peripheral-memory, memory-peripheral, peripheral-peripheral) and, in case of a peripheral, you also program the peripheral type.
In a number of places the user manual mentions which peripherals are supported. For the lpc17xx these are SSP 0/1, ADC, I2S 0/1, DAC and UART 0/1/2/3.
Peripheral transfers are only possible for these devices. The DMA controller needs some way of synchronizing its read/write actions with data being available at the device (i.e. data being available in a FIFO to start a read or a FIFO not being full to write).
So to answer your questions:
Quote:
Can a transfer from memory to GPIOn (accessed as a byte) be done as a memory to peripheral transfer, and if so, can I use the SSP1TX DMACBREQ signal to gate the GPIO transfer to be sure that the previous ssp transfer has completed before the GPIO is set or cleared by the GPIO LLI?
No, GPIO is not a peripheral as mentioned in the list. You need to use a memory transfer for this.
No, there is no way to use DMACBREQ to gate the progression in the scatter/gather list.
It is not possible to combine the two transfer types on one DMA channel using scatter/gather, a channel is programmed to be active with only one transfer type to only one peripheral. It is not possible to combine transfers to different peripherals (or TX/RX part of a peripheral) and/or memory on one scatter/gather channel.
The only way I see to solve this is using the interrupt from the SPI channel to guard each DMA driven SPI transfer.
Scatter/Gather is meant to be used for devices that need continuous, uninterrupted data streams that require a hard real time aspect. As an example; we have used scatter/gather with an MP3 player where the DMA streams blocks of audio to SSP, DAC or I2S while the processor is decoding new data and adding items to the linked list while doing so.
Regards,[INDENT]Rob
[/INDENT]P.s: using [ CODE ] instead of [ QUOTE ] keeps the indentations and uses a fixed with font making code more readable.