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.

Changing adc input on channel 1 affects channel 2 ?

Other Parts Discussed in Thread: MSP430FR5739

I have p3.0 (channel 1) and p3.2 (channel 2) setup as two analog input.

Using a variable resistor, I change the input  on channel 1 with nothing connected on channel 2.

As the the value of channel 1 changes, channel 2 value seems to change proportionally.  What's causing channel 2 to change when there's nothing connected? Ch 2 is externally pulled low with a 4.7k resistor.

//ADC SETUP
/////////////////////////////ADC Initialization/////////////
ADC10CTL0 = ADC10SHT_10 + ADC10ON; // 16ADCclks, ADC on
ADC10CTL1 = ADC10SHS_0 + ADC10CONSEQ_0 + ADC10SSEL_0; // bit trigger,MOD CLOCK SOURCE
ADC10CTL1 |= ADC10SHP; //pulse-mode select. sampcon signal sourced from sampling timer
ADC10CTL2 = ADC10RES; // 10-bits of resolution
ADC10MCTL0 = ADC10SREF_1; //

//ADC pin select for A1 and A2
P3SEL1 |= BIT0 + BIT2;
P3SEL0 |= BIT0 + BIT2;
P2SEL1 |= BIT4;
P2SEL0 |= BIT4;

while (1){
ADC10MCTL0 |= ADC10INCH_12;//selects channel 12
__delay_cycles(50000);
channelcase=5;
ADC10CTL0 |=ADC10ENC+ ADC10SC; // Sampling and conversion start for ADC
while (ADC10CTL1 & ADC10BUSY); // Wait if ADC10 core is active


ADC10CTL0 &=~ADC10ENC;
ADC10MCTL0 &= ~ ADC10INCH_15;
ADC10MCTL0 |= ADC10INCH_14;//selects channel 14
_delay_cycles(50000);
channelcase=6;
ADC10CTL0 |=ADC10ENC+ ADC10SC; // Sampling and conversion start for ADC
while (ADC10CTL1 & ADC10BUSY);

ADC10CTL0 &=~ADC10ENC;

ADC10MCTL0 &= ~ ADC10INCH_15;


//__delay_cycles(5000);
}//end of while loop

  • You didn't specify which MSP430 device you are using, and it looks like it's not the G2xxxx series on Launchpad.

    You talk about channels 1 and 2, but the code looks like it is selecting A14 and A15.

    One thing to consider is that it is a sample and hold input. So you are charging a capacitor through a series resistance, and the rate of charge is controlled by your external signal's source impedance.

    It might me be that when you switch to the next channel (with the 4.7K to ground) that the sample time is too short for the internal capacitor to fully discharge.

    I would recommend modelling the circuit in spice (the datasheet has values for internal impedance and capacitance) with your external circuit and doing a step-response transient analysis to see what your sample time needs to be. Then based on your clock source frequency, determine the setting needed for the sample and hold timer.

  • cuong nguyen1 said:

    ... Using a variable resistor, I change the input  on channel 1 with nothing connected on channel 2. ...

    What you called nothing is actually a high impedance connection (due to leakage) to channel 1 and other nearby signals.

    Connect something to channel 2 and repeat your test.

  • Nvm works fine on my board. I was using the msp430fr5739 launchpad to do testing and it seems the analog input pins were also connected to other stuff. 

  • old_cow_yellow said:
    What you called nothing is actually a high impedance connection (due to leakage) to channel 1 and other nearby signals.

    Connect something to channel 2 and repeat your test.

    Read his post fully. Next paragraph he states:

    cuong nguyen1 said:
    Ch 2 is externally pulled low with a 4.7k resistor.

  • I see,

    nothing => 4.7k to ground => some other stuff

**Attention** This is a public forum