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.

MSP430FR2422: MSP430FR2422

Part Number: MSP430FR2422

I have written code for multi channel single conversion. I am using 3 channel but all the channel same values is coming .

And i want to test 3 channel continues interrupt method. how it is possible. please guide me 

  • Hi Mutharagan,

    I recommend that you start with the examples provided here:

    https://dev.ti.com/tirex/explore/node?node=AOHibD2F6gfbdA6GAGpeEw__IOGqZri__LATEST

    and make incremental modifications to meet your requirements.

    BR,
    Leo

  • If you're using CONSEQ=1, MSC=1, and MODOSC (SSEL=0) you won't succeed in grabbing the first two results before the third one arrives.

    The FR2 series doesn't have DMA or a DTC (as seen in the Related Thread), and has only one ADCMEM register.

    If you use MSC=0 and a timer trigger (SHS=2) you can space the triggers out using the timer period to give your code enough time to fetch each result. You can also get this effect using ACLK (SSEL=1) and/or a large SHT value, but this has the side-effect of making your sample/hold period very long.

  • Dear Sir,

    Thanks for your timely help. This help is really appreciated. I understood MSP430FR2422 controller has only one ADCMEM0 register.

    I have some queries in the below mention points.

    1. Controller need to moinitor the channel1 for continous interrupt for 10 microseconds and also in parallely measuring the 2nos  channel  by polling method. This our requirement. Please could you guide me.

    2. I have written code for 2nos channel by polling method. But if any changes in any one of channel. Another channel value also get affected and some times i am not able to change the value.

    These are my hard code for 2 nos channel polling method. Could you please give me some idea. One channel input is stable. Another channel value is varying.

    void ADC_Configuration(void)

    {

       // Configure ADC10

    #if 0

         ADCCTL0 |= ADCSHT_2 | ADCON;                             // ADCON, S&H=16 ADC clks

         ADCCTL1 |= ADCSHP;                                       // ADCCLK = MODOSC; sampling timer

         ADCCTL2 |= ADCRES;                                      // 10-bit conversion results

         ADCMCTL0 |= ADCINCH_0;                                   // A0 ADC input select; Vref=AVCC

         ADCIE |= ADCIE0;                                         // Enable ADC conv complete interrupt

    #endif

     

    #if 1

           ADCCTL0 |= ADCSHT_2 | ADCON;

           ADCCTL1 |= ADCSHP;                                       // ADCCLK = MODOSC; sampling timer

          ADCCTL2 |= ADCRES;

    #endif

    }

     

    void ADC_ChannelConfiguration(void)

    {

       // Configure ADC A0 ,A1pin

         SYSCFG2 |= ADCPCTL0 |ADCPCTL1;

    }

    void ADCstartEvent(void)

    {

       ADCCTL0 |= ADCENC | ADCSC;                           // Sampling and conversion start

     

    }

    void ADC_TVSdiodeTemperature(void)

    {   SYSCFG2 |= ADCPCTL0;

       ADCCTL1 |= ADCCONSEQ_0;

       ADCMCTL0 |= ADCINCH_0;                                 //P1.0 CHANNEL A0

       ADCstartEvent();

       while(ADCCTL1 & ADCBUSY);

       TVSTempCount += ADCMEM0;

       Count1++;

       SYSCFG2 &=~ ADCPCTL0;

       ADCCTL0 &= ~ADCENC;

       if(Count1>100)

       {

           TVSTempCount =TVSTempCount/100;

           TVSTempVolatge =TVSTempCount * 3.3/1024;

           TVSTempCount=0;

           Count1 =0;

       }

    }

    void ADC_TVSdiodeLeakageCurrent(void)

    {   SYSCFG2 |=ADCPCTL1;

         ADCCTL1 |= ADCCONSEQ_0;

         ADCMCTL0 |= ADCINCH_1;

         ADCstartEvent();

         while(ADCCTL1 & ADCBUSY);

         LekageCount+=ADCMEM0;

         Count2++;

         SYSCFG2 &=~ADCPCTL1;

         ADCCTL0 &= ~ADCENC;

         if(Count2>100)

         {

             LekageCount = LekageCount/100;

             TVSLkgVoltage = LekageCount *3.3/1024;

             LekageCount=0;

             Count2=0;

         }

    }

  • > ADCMCTL0 |= ADCINCH_0; 

    This doesn't set ADCINCH=0, since ADCINCH_0=0. I suspect this is the failure you're seeing. Since you're not using ADCSREF, the simplest fix would be:

    >  ADCMCTL0 = ADCINCH_0; 

    ------------

    >    ADCCTL2 |= ADCRES;

    This sets ADCRES=3 which is Reserved (illegal). I suspect you wanted:

    >    ADCCTL2 |= ADCRES_1;   // ADCRES=1 (10-bit)

**Attention** This is a public forum