AnsweredAssumed Answered

How to configure multi-channel ADC with DMA

Question asked by Ryan Ramanathan on Jun 4, 2015

I have a FRDM-K64 evaluation board.

I am developing using KSDK.

I am trying to setup 4 ADC channels each at 50Ksps using EDMA:

    ADC0 Channels:  0 & 1

    ADC1 Channels: 0 & 1

I have setup PDB trigger channels and they are working without the DMA.

Also I got ADC0 channel0 and ADC1 channel0 to work with DMA.


Now I am trying to get flexible scan mode to work so that both ADC0 channels can be dumped into the memory buffer using DMA.

How do I setup the elink DMA channel to trigger and toggle between ADC0 channel0 and 1?  (Using KSDK)

-  I have DMA channel 1 (ADC conversion --> Memory)

-  DMA channel 0 the elinked channel to set ADC0_SC1A toggling between kAdc16Chn0 & kAdc16Chn1

-  DMA channel 1 is setup to ping pong between two buffers so that when one is being written to, the other buffer can be transferred to SD Card/ USB memory.

- PDB is setup to have a single channel group pre trigger


Also can't I use PDB0 soft interrupt to trigger DMA channel 0 (ADC0_SC1A)  instead of elink? 

I have tried using EDMA_DRV_ConfigLoopTransfer and EDMA_HAL_HTCDSetChannelMinorLink.

You can find incomplete code attached.



Original Attachment has been moved to: