I'm working on integrating an accelerometer(ADXL335) into my project. So I'm doing three single channel conversions, on the three axes. The first conversion I do gives me a normal reading for horizontal, ~450. The other ones give me ~880 and ~1020. I have switched the axes and the first one always gives me the correct value the others don't. The following code shows my ADC function.
int Acc(char channel)
{
int res, ch;
ch = channel * 0x1000;
ADC10CTL0 &= ~ENC;
ADC10CTL0 |= ADC10ON;
ADC10CTL1 = ch + ADC10SSEL_3;
ADC10CTL0 |= ENC + ADC10SC;
while(ADC10CTL1&