Part Number:MSP430G2131
Hi,
after many projects with the ADC12 I am having some difficulties with the ADC10 and its way of storing the samples from the conversion memory ADC10MEM to another memory location.
I want to sample from 3 inputs (A0 to A2) in "Repeat-sequence-of-channels" mode. My setup code looks as follows.
ADC10AE0 = 0x07; ADC10CTL1 = INCH_2 + ADC10SSEL_2 + ADC10DIV_2 + CONSEQ_3; ADC10CTL0 = SREF_1 + ADC10SHT_2 + MSC + REF2_5V + REFON + ADC10ON; ADC10DTC0 = ADC10CT; ADC10DTC1 = 3; ADC10SA = (unsigned int)Samples; ADC10CTL0 |= ENC + ADC10SC;
I fetch the buffer in an ADC interrupt routine.
The sampled data appears in my buffer Samples[]. The problem is that the order of channels in the buffer is changing all the time, i.e. A0 appears in Samples[0], Samples[1] and Samples[2].
Is there anything wrong in my code?
Best regards
Jan