Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CCS/TMS320F28027: About ADC Configuration

$
0
0

Part Number:TMS320F28027

Tool/software: Code Composer Studio

Hello ,

I am a newbie to microcontrollers. I started learning about ADC configuration from example "adc_soc". I didn't understand the following. please help

/ Wait for ADC interrupt
   for(;;)
   {
      LoopCount++;
   }
}

why LoopCount++ loop is required?

__interrupt void adc_isr(void)
{
  Voltage1[ConversionCount] = AdcResult.ADCRESULT1;  //discard ADCRESULT0 as part of the workaround to the 1st sample errata for rev0
  Voltage2[ConversionCount] = AdcResult.ADCRESULT2;

  // If 20 conversions have been logged, start over
  if(ConversionCount == 9)
  {
     ConversionCount = 0;
  }
  else
  {
      ConversionCount++;
  }

  AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;  //Clear ADCINT1 flag reinitialize for next SOC
  PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;   // Acknowledge interrupt to PIE

  return;
}

I have understood that adc_isr function is called in the " PieVectTable.ADCINT1 = &adc_isr;"

but what is the fuction of it and how come the loop is continuing?


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>