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.

DMA2 Problem on MSP4305510

Other Parts Discussed in Thread: MSP430F5510

Hello,

I'm working on a simple code witch make 8 AD conversions with DMA... The following code works fine with DMA0 and DMA1 but when I change to DMA2 the debugger stays on    "__delay_cycles(5000)". 


#include "msp430f5510.h"


unsigned int ADC_Result[8];

void main(void)
{
WDTCTL = WDTPW + WDTHOLD;                                                           // Stop WDT

// Configure ADC10 - pulse sample mode; TB0 trigger; rpt single channel
ADC10CTL0 = ADC10SHT_2 + ADC10ON;                                           // 16ADCclks, ADC10 on
ADC10CTL1 = ADC10SHP + ADC10SHS_2 + ADC10CONSEQ_2; // sampling timer, TimerB0.0 trigger
// trigger, rpt single channel
ADC10CTL2 = ADC10RES;                                                                       // 10-bits resolution
ADC10MCTL0 = ADC10SREF_0 + ADC10INCH_0;                             // Vcc, A0

// Configure DMA (ADC10IFG0 trigger)
DMACTL0 = DMA0TSEL_24;                                                                      // ADC10IFG trigger
__data16_write_addr((unsigned short) &DMA0SA,(unsigned long) &ADC10MEM0);
// Source single address
__data16_write_addr((unsigned short) &DMA0DA,(unsigned long) &ADC_Result[0]);
// Destination array address
DMA0SZ = 8; // 8 conversions
DMA0CTL = DMADT_4 + DMADSTINCR_3 + DMAEN + DMAIE;               // Rpt, inc dest, word access,
// enable interrupt after 8 conversions


// Configure Timer Trigger TB0.0
TB0CCR0 = 256-1;                                                             // TB0.0 Period
TB0CCTL0 = OUTMOD_4;                                                // TBCCR0 toggle (ON period = ~7.8ms)
TB0CTL = TBSSEL_1 + MC_1 + TBCLR;                       // ACLK, up mode

while(1)
{
while (ADC10CTL1 & ADC10BUSY);               // Wait if ADC10 core is active
ADC10CTL0 |= ADC10ENC;                              // Sampling and conversion ready
__bis_SR_register(CPUOFF + GIE);               // Enter LPM3, enable interrupts

__delay_cycles(5000);                                    // Delay between conversions
__no_operation();                                            // BREAKPOINT to check ADC_Result
}
}

#pragma vector=DMA_VECTOR
__interrupt void DMA0_ISR (void)
{
switch(__even_in_range(DMAIV,16))
{
case 0: break; // No interrupt
case 2: // DMA0IFG

__bic_SR_register_on_exit(CPUOFF);

break;
case 4:                                      // DMA1IFG
__bic_SR_register_on_exit(CPUOFF);

break;
case 6: // DMA2IFG
__bic_SR_register_on_exit(CPUOFF); // exit LPM

break;
case 8: break;                                  // Reserved
case 10: break;                                // Reserved
case 12: break;                                // Reserved
case 14: break;                                // Reserved
case 16: break;                                // Reserved
default: break;
}
}

When I change the "0" in the yellow expressions by a "1" the code works but not when I change by a "2"..... Any Idea??

Thanks in advance!

**Attention** This is a public forum