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.

analog read with ADC10 Repeat-Sequence-of-Channels Mode with the MSP430G2553

hello everybody, I was looking for an example of code to an analog read in Repeat-Sequence-of-Channels mode with the ADC10 without using CPU resources.

I think that I can understand the functioning of ADC10 module but I need an example of code to use correctly the module.

actually I did the following code to read an analog value:

int ADC;
void read_Ax(void)
{

ADC10CTL1 = INCH_x;
ADC10CTL0 = ADC10ON;
ADC10CTL0 |= ENC + ADC10SC;
_delay_cycles(10000);
ADC10CTL0 &= ~ENC;
ADC10CTL0 &= ~(ADC10ON);

ADC = ADC10MEM;

}

Of course Ax most be A0, A1, A2,.. and de code it's just an void function.

the code it works but I need to do the same for 4 analog inputs without using CPU resources. I know that It can be done with the Data Transfer Controller DTC but I need an example.

please I need an example code

  • Hi Manuel!

    Did you have a look at the code examples already? There are:

    • msp430g2x33_adc10_07.c                     ADC10, DTC Sample A1 32x, AVcc, Repeat Single, DCO
    • msp430g2x33_adc10_10.c                     ADC10, ADC10, DTC Sample A3-01, AVcc, Single Sequence, DCO

    One explains repeated conversions and the other how to sample a sequence.

    Dennis

**Attention** This is a public forum