adc how to triggle DMA request in MPC57x

cancel
Showing results for 
Search instead for 
Did you mean: 

adc how to triggle DMA request in MPC57x

198 Views
大大许
Contributor III

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 ?

 

Labels (1)
1 Reply

46 Views
petervlna
NXP Employee
NXP Employee

Hi,

Always specify the device you are using. MPC57xx devices are quite different and also implement different rooting of signals.

But I see here the issue anyway:

1. You are configuring DMAMUX channel 0

pastedImage_1.png

2. You are enabling in DMA requests from channel 8

pastedImage_2.png

Your DMA will never start. As the trigger from ADC is routed in DMAMUX channel 0 and DMA is waiting for channel 8 to trigger it.

Use : DMA.ERQ.B.ERQ0 = 1; //open hardware request

Peter