This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Externally triggering DMA transfer?



Hi!  I hope I have a quick and simple question to answer.  I have looked at the examples, but I cannot figure out how to make this work.

I have an ADC attached to the 28346 via the 2 McBSP (SPI  mode) ports.  When the ADC has finished its conversion, I want it to give the DMA a signal that the data is ready and that it should come and get it.

I hook up a GPIO pin to the ADC signal line, but when the ADC signals the DMA by clearing the signal, instead of starting the DMA, it calls the XINT1_ISR defined in DSP2834x_DefaultIsr.c.

Is there a way to not call the ISR and simply trigger the DMA to begin to read the data?

I set up the XINT1 from the examples like this:

void InitInterruptGpio(void)
{
// GPIO0 is input
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0; // GPIO
GpioCtrlRegs.GPADIR.bit.GPIO0 = 0; // input
GpioCtrlRegs.GPAQSEL1.bit.GPIO0 = 0; // Xint1 Synch to SYSCLKOUT only
GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 0; // Xint1 is GPIO0
EDIS;

// Configure XINT1
XIntruptRegs.XINT1CR.bit.POLARITY = 0; // Falling edge interrupt
// Enable XINT1
XIntruptRegs.XINT1CR.bit.ENABLE = 1; // Enable Xint1

}

I then attached the interrupt to my DMA channel like this:

DmaRegs.CH1.MODE.bit.PERINTSEL = DMA_XINT1; // Peripheral interrupt select = External Interrupt 1 - XINT1

Is there something I am missing here?  I get the interrupt, but it seems to call the ISR for XINT1 instead of triggering the DMA.  How should I set this up?

Thanks!

-Jeff

  • Jeff,

    If you don't want to receive the XINT interrupt you'll need to disable it somewhere in its path to the PIE.  Since you're receiving it, somewhere in your code you have:

       PieCtrlRegs.PIEIER1.bit.INTx4 = 1;          // Enable PIE Group1 INT4

    If you comment out this line it will make it so you no longer receive the XINT1 ISR on an XINT1 event.

    Now, if this isn't triggering your DMA we need to take a look at your initialization code for the DMA.  Have you tried forcing the event via the PERINTFRC bit to confirm if the DMA is setup properly?  Note that a force only creates a single event, so if the transfer begins on the Xth event you'll need to force X times.  If the force works but the XINT is still not causing the DMA to trigger, try selecting a CPU timer as the trigger source to see if this works.

    One thing for the DMA that comes to mind which is easy to forget is forgetting to start the channel via the RUN bit.

    Kris

  • Hi Kris,

    Thanks - that was indeed the issue (I had enabled the PIE Group1 Int4)!  I now see the GPIO triggering without going to the ISR, and the DMA is running!  Thank you for the quick and accurate response!  

    -Jeff