This is regarding auxilary ADC (ADC1).  I am measuring single ended values in unipolar against ADC5 (which is connected to GND).

=====================================================================

ADCFLT = 0x4F;           // Chop off, 100hz samping rate. No averaging.  also resets both ADCs

ADCMDE = BIT7 + BIT1;           // [7]=512Khz, [4:3]=normal pwr, [2:0]=2 (single conversion)

Vtemp = Vtemp/65535 * 1.2;    // convert to voltage (internal ref = 1.2V)

=====================================================================

ADCFLT = 0x4F;               // Chop off, 100hz samping rate. No averaging.  also resets both ADCs

ADCMDE = BIT7 + BIT1;           // [7]=512Khz, [4:3]=normal pwr, [2:0]=2 (single conversion)

Vtemp = Vtemp/65535 * 1.2;    // convert to voltage (internal ref = 1.2V)

I experience the following problems:

-- readings are all over with 50% variations.  My source is very clean on oscilliscope

What do I have to do to measure a high impedance source?  I tried sampling down to 50Hz, chop on, averaging, delay between two reads.. but nothing works

Parents
• Thanks, I understand now that ADC6 thru ADC9 will not work until GP0CON1 is written a 0x1.  I was previously writing a value of 0x2

I can not seem to write a value of 0x1 to GP0CON1.  I had no problem writing 0x2 previously.

Here's my code:

GP0CON0 = 0;

GP0KEY1 = 0x7;

GP0CON1 = 1;           // 8-bit. Bit[1]=0 (I2C), bit[0]=1 (ADC)

GP0KEY2 = 0x13;

What could be the problem?

Also, I can not afford to loose all 4 pins, as I am using I2C bus on P0.1 & P0.3.  Since ADC6 is only read at power up, can I switch back the GP0CON1, after I take my reading for rest of the program?

• Thanks, I understand now that ADC6 thru ADC9 will not work until GP0CON1 is written a 0x1.  I was previously writing a value of 0x2

I can not seem to write a value of 0x1 to GP0CON1.  I had no problem writing 0x2 previously.

Here's my code:

GP0CON0 = 0;

GP0KEY1 = 0x7;

GP0CON1 = 1;           // 8-bit. Bit[1]=0 (I2C), bit[0]=1 (ADC)

GP0KEY2 = 0x13;

What could be the problem?

Also, I can not afford to loose all 4 pins, as I am using I2C bus on P0.1 & P0.3.  Since ADC6 is only read at power up, can I switch back the GP0CON1, after I take my reading for rest of the program?

Children
No Data