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.

ADC10A issue with MSP430F6733

Other Parts Discussed in Thread: MSP430F6733

Hi,

i am working on MSP430F6733 and trying to use ADC10A in "Repeat-Single-Channel Mode".

Even after configuring ADC and starting conversion, ADC10BUSY is never cleared or interrupt never raised after conversion.

Below is code snippet:

void InitSarADC(void)
{


  P1DIR &= 0xFD;                                 // Configure A1/P1.1 as input
  P1SEL |= 0x02;                                  // Select Analog fn
  PMAPPWD = 0x2D52u;                   
  PMAPCTL = PMAPRECFG;
  P1MAP0 = 31;                                   // Configure Map register


  ADC10CTL0   = 0x00;                    // Disable ADC
  ADC10CTL0  |= 0x10;                    //  ADC On
  ADC10CTL0  |= 0x290;                  // ADC10MSC
  ADC10MCTL0  = 0x01;                  // Select A1
  ADC10CTL1   = 0x06F4;               // Repeat-single-channel + MCLK + clock / 8 + SAMPCON  sourced from the sampling timer T0.
  ADC10CTL2   = 0x10;                   // 10 bit

  ADC10IE     = 0x33;                       // Configure Interrupt


}
void StrtConv(void)

   ADC10CTL0 |= 0x03;         //Enable conversion
}


ISR( ADC10_VECTOR, ADC10_SAR )
{
  tUI16 Temp;
  RT++;
  if(RT > 10 )
  {
   Temp = ADC10MEM0;
   Temp += RT;
  }
}

Any suggestions?

 

 

  • You chose the "Repeat-Single-Channel Mode".  and in you code

    void InitSarADC(void)
    {

      P1DIR &= 0xFD;                                 // Configure A1/P1.1 as input
      P1SEL |= 0x02;                                  // Select Analog fn
      PMAPPWD = 0x2D52u;                   
      PMAPCTL = PMAPRECFG;
      P1MAP0 = 31;                                   // Configure Map register


      ADC10CTL0   = 0x00;                    // Disable ADC
      ADC10CTL0  |= 0x10;                    //  ADC On
      ADC10CTL0  |= 0x290;                  // ADC10MSC
      ADC10MCTL0  = 0x01;                  // Select A1
      ADC10CTL1   = 0x06F4;               // Repeat-single-channel + MCLK + clock / 8 + SAMPCON  sourced from the sampling timer T0.
      ADC10CTL2   = 0x10;                   // 10 bit

      ADC10IE     = 0x33;                       // Configure Interrupt

    }

    that makes  the ADC10 module works all the time. After one sample point completed , the second sample prosecc begains immediately, it behaves like that the ADC10BUSY bit  always in SET state.(especially in simulate mode),if U want to deal with the data after a couple of sample times,you'd better reset ADC10ENC bit first or the ADC10  will

    keep in work in  the backgound and the flag will set immediately once again.(my english is quie bad ,hope that helps)

    ISR( ADC10_VECTOR, ADC10_SAR )
    {
      tUI16 Temp;
      RT++;
      if(RT > 10 )
      {

    ;//------people always set a breakpoint at this location
       Temp = ADC10MEM0   Temp += RT;
      }
    }

     

     

  • Hi Benny,

     

    I found the issue. Thanks anyways for replying.

    Dushyant

**Attention** This is a public forum