AnsweredAssumed Answered

LPC55S69 DMA Channel Chain Example

Question asked by Charles Lonsdale on Mar 15, 2019
Latest reply on Mar 19, 2019 by Charles Lonsdale

I have been trying to understand how to configure the InputMux to chain DMA's using the DMA Channel Chain Example, and I have come to the conclusion that the example doesn't quite do what it says in the readme.txt.

The original configuration for the input mux is:

 

#define DEMO_DMA_CHANNEL_TRIGGER_INPUT0 kINPUTMUX_Otrig0ToDma0
#define DEMO_DMA_CHANNEL_TRIGGER_OUTPUT0 kINPUTMUX_Dma0Hash0TxTrigoutToTriginChannels

 

    INPUTMUX_Init(INPUTMUX);
    INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL2, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);
    INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL1, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);
    INPUTMUX_AttachSignal(INPUTMUX, 0, DEMO_DMA_CHANNEL_TRIGGER_OUTPUT0);
    INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL0, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);

 

I think that the completion of DMA channel 0 triggers DMA channels 1, 2 and the second transfer of DMA channel 0, rather than the completion of DMA channel1 causing the second descriptor of DMA channel 0 to execute (as suggested in the readme).

 

I have changed the inputmux configuration as follows:


#define DEMO_DMA_CHANNEL1 1
#define DEMO_DMA_CHANNEL0 0
#define DEMO_DMA_CHANNEL2 2
#define DEMO_DMA_CHANNEL_TRIGGER_INPUT0 kINPUTMUX_Otrig0ToDma0
#define DEMO_DMA_CHANNEL_TRIGGER_INPUT1 kINPUTMUX_Otrig1ToDma0
#define OTRIG0 0
#define OTRIG0 1
#define DEMO_DMA_CHANNEL_TRIGGER_OUTPUT0 ((DMA0_OTRIG_INMUX0 << PMUX_SHIFT) + DEMO_DMA_CHANNEL0)
#define DEMO_DMA_CHANNEL_TRIGGER_OUTPUT1 ((DMA0_OTRIG_INMUX0 << PMUX_SHIFT) + DEMO_DMA_CHANNEL1)

 

INPUTMUX_Init(INPUTMUX);
INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL2, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);
INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL1, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);
INPUTMUX_AttachSignal(INPUTMUX, OTRIG0, DEMO_DMA_CHANNEL_TRIGGER_OUTPUT0);
INPUTMUX_AttachSignal(INPUTMUX, OTRIG1, DEMO_DMA_CHANNEL_TRIGGER_OUTPUT1);
INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL0, DEMO_DMA_CHANNEL_TRIGGER_INPUT1);

 

I think this more clearly shows how to configure the example as per the readme. If I have it wrong, please comment.

Hope this helps someone.

 

Charles

Outcomes