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.

CCS/MSP430FR5857: ADC sampling by timer triggered for sequence of channels are not working properly

Part Number: MSP430FR5857

Tool/software: Code Composer Studio

Dear Sir / Madam ,

I am using MSP430FR5857 MICRO CONTROLLER for my application. I am sensing AC voltage sensing, AC current sensing and   PWM signal which is generated by microcontroller itself  on channel A1, A2,A3 respectively . I have used same PWM signal timer triggered for ADC sampling for all the three channel in sequence of channel mode and even tried in repeat sequence of channel mode but not getting all the three channels ADC value properly .Even example code i have seen for single repeat  sequence of channel mode but nothing much helpful .

i have given below my ADC configuration and timer configuration also same timer is used for generating interrupt for reading all these values .

    ADC12CTL0=ADC12SHT0_0 | ADC12ON | ADC12MSC    ;
    ADC12CTL1=ADC12SHS_1 | ADC12SHP | ADC12CONSEQ_1 |ADC12SSEL_3  ;
    ADC12MCTL0 |= ADC12INCH_3;
    ADC12MCTL1 |= ADC12INCH_2;
    ADC12MCTL2 |= ADC12INCH_1 | ADC12EOS;
    ADC12CTL0 |=  ADC12SC | ADC12ENC ;

timer configuration

      TA0CCR0 = 16000;  // SET TIMER PERIOD
     TA0CCTL1 = OUTMOD_3;  // SET OUTPUT MODE RESET/SET
     TA0CCR1 = 11734;

    TA0CCTL0 =CCIE;

    TA0CTL = TASSEL__SMCLK | MC__UP

Please reply as soon as possible . I will be awaiting for your kind response.

  • With CONSEQ=1 and SHS>0, you need to toggle ENC (low then high) at the end of each sequence to allow the next tigger/sequence to occur. [Ref UG (SLAU367O) Sec. 34.2.8.2]

    You also need to set P1SELx.[1-3] =0b11 to get reasonable readings from the pins. [Ref DS (SLASE34E) Tables 6-48/49]

  • i have toggled ENC , but that still did not give values proper ,  later ADC12SHT0_0 i changed to ADC12SHT0_4 which means sample and hold cycles is 64 clock cycles then i got the values proper .

    But still i did not get with repeat sequence of channel how to implement ?

    P1SELx.[1-3] =0b11 these bits i configured while port initialization

    Hoping for your reply soon

  • There's a formula in User Guide (SLAU367O) Section 34.2.6.3 to estimate the appropriate SHT0 time.

    "Repeat Sequence of Channels" mode is requested using CONSEQ=3 [Ref UG Sec 34.2.8.4]. Based on what you've said, this mode will not give you what you're looking for.

**Attention** This is a public forum