AnsweredAssumed Answered

DMA multi-channles interrupt issue

Question asked by Dawei You Employee on Aug 27, 2014
Latest reply on Sep 1, 2014 by Dawei You

Hi:

 

I have question for DMA milti-channel interrupt.

I have ch0 and ch1 for PDB-DMA-ADC-DMA-SRAM circle sampling project, which is OK alone.

another application is to use DMA ch14 and ch15 to complete UART tx and rx, rx is one byte DMA receive interrupt(for test).

these two projects are OK alone, but when they work together, they will conflict when testing.

I design one test case, PDB almost  60us once to trigger almost 8 channels ADC conv, after all channels completed, DMA0_ISR will be called to set DMA1_ERQ, which will allow PDB could trigger ch1 again next time. the code  like below.

void dma0_isr(void)

{

  DMA_ERQ |= DMA_ERQ_ERQ1_MASK; //置ERQ1的使能,通道1的使能

  flag++;

 

  DMA_CINT = 0x00; //clear int

  DMA_CDNE = 0x00; //clear done

}

 

UART isr continuely to tx and rx with PC, make sure the UART is busy.

 

Then after some time works successfully, the ch1 ERQ never be set again, but DMA0 INT also not set.

which means, the ADC circule is destroyed, and never recover.

 

I try to change channle priority or ECP and DAP for suspent channel, but not works, like that

        DMA_DCHPRI0 = 0x4E;

        DMA_DCHPRI1 = 0x4F; 

       

        DMA_DCHPRI14 = 0xC1;

        DMA_DCHPRI15 = 0xC0; 

 

I want to know, why the INT flag for DMA_CH0 dispears but the DMA_ERQ_ERQ1_MASK not set?

which should be completed in same ISR --- void dma0_isr(void), but from the debug view, the INT flag is cleared, but ERQ not set? seems which is not releatd with channels priority and arbitration.

Thx for your support.

Outcomes