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.
Tool/software: Starterware
Hello ,
I want to use DMA tran tansmit ADC data to FRAM . The ADC mode is Repeat-Sequence-of-Channels Mode from ADC12MCTL0 to ADC12MCTL1, ADC trigger signal is TA0.1 . the code is following
//ADC12(internal) trigger ,TA0.1 PWM 8.192KHz from 32.768KHz crystal oscillator TA01_PWMOUT(4, 2, TASSEL__ACLK); // Set ADC channel pins ADC_Pin_Set(); ADC12CTL0 &= ~ADC12ENC; ADC12CTL0 |= ADC12ON; //ADC12_B sample-and-hold time ADC12CTL0 |= ADC12SHT1_1; //a rising edge of the SHI signal to trigger each sample-and-convert ADC12CTL0 &= ~ADC12MSC; // ADC trigger TA0.1, ADC clock is SMCLK ADC12CTL1 |= ADC12SHP | ADC12SHS_1 | ADC12PDIV__1 | ADC12DIV_0 | ADC12SSEL_3; // Repeat-sequence-of-channels ADC12CTL1 |= ADC12CONSEQ_3; //12bit ADC ADC12CTL2 |= ADC12RES_2; //Start Mem ADC12CTL3 = ADC12CSTARTADD_0; //MemCtl set ADC12MCTL0 |= ADC12INCH_2 | ADC12VRSEL_1; ADC12MCTL1 |= ADC12INCH_3 | ADC12VRSEL_1; //End Mem ADC12MCTL1 |= ADC12EOS; //DMA Set DMACTL0 |= DMA1TSEL__ADC12IFG; __data16_write_addr((unsigned short) &DMA1SA,(INT16U) &ADC12MEM1); __data16_write_addr((unsigned short) &DMA1DA,(INT16U) &ElecfieldBuffer[0]); DMA1SZ = 5120; DMA1CTL = DMADT_4 | DMADSTINCR_3 | DMASRCINCR_0 |DMASWDW |DMAEN ;
"When CONSEQx = {1,3}, theADC12IFG flag for the last ADC12MEMx in the sequence can trigger a DMA transfer. " (Page 336 of MSP430FR6972 User's Guide) . I know that only the ADC12IFG of ADC12MEM1 can trigger a DMA transfer , But I found it not as . The DMA wasted 625ms to accomplish 5120 points . However,the theory of time shoud be (1/8.192KHz) * 2 * 5120 = 1250ms . Why is it ?
Best Regards,
Jent
thank you Ryan ,
I set the sequence mode and every convesion must be trigger by TA0.1, so A2 will be converted at the frist 122miscroseconds , A3 will be converted at the second 122 miscroseconds ,then A2 will be converted at the third 122 miscrosecondes again. In conclusion , the sample time of A2 is 244 miscroseconds , A3 is the same as A2. It will cost 5120 X 244 = 1250ms to transmit 5120 word .
I found the reason from MSP430FR6972 Device Erratasheet(Page 3), But I thought the workaround doesn't fit my demand. I want the A2 and A3 will be stored in two array[5120] continuously without using interrupt . Do you have good idea ?
Best Ragards
Jent
**Attention** This is a public forum