AnsweredAssumed Answered

adc how to triggle DMA request in MPC57x

Question asked by 大大 许 on Nov 3, 2017
Latest reply on Nov 6, 2017 by Peter Vlna

Hi,

I want to use adc0_channel8 EOC condition to triggle dma transfer request.

ADC0_CHANNEL8 be in scan mode,DMA transfer use single requestion way to work,but DMA transfer is not triggle when adc0_ch8 has an eoc condition.In my test code ,I try to poll TCD[0].CSR.DONE flag has setted,then to read input buffer number. my code setting is follow:

 DMA_0.CR.B.CX = 0;      //normal operate mode
 DMA_0.CR.B.ECX = 0;
 DMA_0.CR.B.GRP1PRI = 1;    //Fixed priority arbitration
 DMA_0.CR.B.GRP0PRI = 0;
 DMA_0.CR.B.EMLM = 1;      
 DMA_0.CR.B.CLM = 0;
 DMA_0.CR.B.HALT = 0;
 DMA_0.CR.B.HOE = 0;
 DMA_0.CR.B.ERGA = 0; 
 DMA_0.CR.B.ERCA = 0;
 DMA_0.CR.B.EDBG = 0;

 

DMA_0.TCD[0].SADDR.R = 0xFBE00120;   //ADC0_CH8_CDR_ADD
DMA_0.TCD[0].ATTR.B.SMOD = 0;   
DMA_0.TCD[0].ATTR.B.SSIZE = 2;       //uint16   
DMA_0.TCD[0].SOFF.R = 4;    

 DMA_0.TCD[0].SLAST.R = -4;

 DMA_0.TCD[0].DADDR.R =(uint32_t) adcDestData;            
 DMA_0.TCD[0].ATTR.B.DMOD = 0;
 DMA_0.TCD[0].ATTR.B.DSIZE = 2;
 DMA_0.TCD[0].DOFF.R = 4;
 DMA_0.TCD[0].DLASTSGA.R = -4;      

 DMA_0.TCD[0].NBYTES.MLOFFNO.B.SMLOE = 0;   //minor loop enable and link-to-link disable
 DMA_0.TCD[0].NBYTES.MLOFFNO.B.DMLOE = 0;   //minor loop offset is applied to the SADDR
 DMA_0.TCD[0].NBYTES.MLOFFNO.B.NBYTES = 4;           //minor loop cnt

 DMA_0.TCD[0].BITER.ELINKNO.B.ELINK = 0;    
 DMA_0.TCD[0].BITER.ELINKNO.B.BITER = 1;    

 DMA_0.TCD[0].CITER.ELINKNO.B.ELINK = 0;
 DMA_0.TCD[0].CITER.ELINKNO.B.CITER = 1; 

DMA_0.ERQ.B.ERQ8 = 1; //open hardware request

DMAMUX_0.CHCFG[0].B.TRIG = 0;
 DMAMUX_0.CHCFG[0].B.SOURCE = 0x12;           //ADC0 slot address
 DMAMUX_0.CHCFG[0].B.ENBL = 1;

How do i set the properties of dma transfer ?

 

Outcomes