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.
Hi,
We have an application that should use 3 channels of SD24 and 15 channels of ADC10 synchronously.
The MSP430 that we use has a special trigger module to trigger ADC10 at the end of every SD24 conversions.
And I configured ADC10 in "repeated-sequence of channels - ADC10CONSEQ_3" mode with auto next conv (MSC set)
And finally, I configured DMA in repeating single transfer mode.
I expect that;
1. SD24 will trigger ADC10.
2. With this single trigger, ADC10 should scan all 15 channels automatically
3. DMA puts all ADC10MEM0 results into my Array[15] automatically.
All this operation should be done without any interrupts and automatic. Next SD24 trigger will come after 1ms and ADC10 should scan 15 channels again. (Scanning 15 channels takes only 50us)
I enabled the DMA interrupt to just see what is going on. I realized that interrupt occurs only one time.
What is the proper way of using ADC10 in repeated-sequence of channels - ADC10CONSEQ_3?
TI didn't provide any example code for repeated-sequence of channels mode.
void init(void) { ADC10CTL0 &= ~ADC10ENC; ADC10IE = 0x00; ADC10IFG = 0; ADC10CTL0 = ADC10SHT0 | ADC10ON | ADC10MSC; // ADC on, ADC10 waits for trigger from the SD24, sampling time 2us (8xADCclk), auto next conv ADC10CTL1 = ADC10SHP | ADC10SHS_3 | ADC10DIV_0 | ADC10SSEL_3 | ADC10CONSEQ_3; // /* Triggered by the SD24, SMCLK = 4MHz, Repeated - Sequence of channels ADC10CTL2 = ADC10RES | ADC10DF; ADC10MCTL0 = ADC10SREF_1 | ADC10INCH_15; // dma settings for 10 bit ADC DMACTL0 = DMA1TSEL__ADC10IFG0; __data16_write_addr((u16)&DMA1SA, (u32)&ADC10MEM0); __data16_write_addr((u16)&DMA1DA, (u32)&ADC.V_10bitADC[15]); DMA1SZ = 16; // Channels 15 to 0 DMA1CTL = DMADT_4 | DMADSTINCR_2 | DMAEN | DMAIE; // Enable, destination address decremented, repeating single transfer ADC10CTL0 |= ADC10ENC; // Start ADC and wait for a trigger from the SD24 } __interrupt void DMA_ISR(void) { switch (__even_in_range(DMAIV, 16)) { case DMAIV_NONE: { break; } case DMAIV_DMA0IFG: // DMA0IFG = DMA Channel 0 { break; } case DMAIV_DMA1IFG: // DMA1IFG = DMA Channel 1 { process_data(); break; } case DMAIV_DMA2IFG: // DMA2IFG = DMA Channel 2 { break; } default: { break; } } }
Thanks.
In that thread;
They said that you should wait at least 3 ADC clocks. This is for ADC14 and not for ADC10. But I'm suspicious about that they use same design.
For my case, MCU clock MCLK = 8 Mhz while ADC10 clock is only 1 Mhz.
**Attention** This is a public forum