Here are some schematics and test that i did on the adc in Differential mode
i noticed also a non symmetry in booth ADCs when zeroing one and driving another ,The following plot shows sampled signal vs input signal peak while driving AIN0.
i use the following code to convert the sampled data to mv , its taken from the datasheet of the C8051F06 IC
float convert_mv(long val_brute){
float voltage_mv;
char old_SFRPAGE = SFRPAGE;
if ( val_brute <= 0x7FFF && val_brute > 0 ) // Positve voltage
{
voltage_mv= ( (val_brute * 2500 /32768.0)/1);
}
else if ( val_brute >= 0x8000 && val_brute <= 0xFFFF ) // Negative voltage
{
voltage_mv= ( ((val_brute-32768) * 2500/32768.0 - 2500)/1 ) ;
}else if(val_brute == 0x0001){
voltage_mv= ( (val_brute * 2500 /32768.0)/1)+2;
}
else if(val_brute == 0xFFFF){
voltage_mv= -( (val_brute * 2500 /32768.0)/1)+2;
}
else if ( val_brute == 0)
voltage_mv= 0;
return voltage_mv;
SFRPAGE = old_SFRPAGE;
}
When driving the ADC with the following circuit i notice an issue that is when I also reach close to VRF, the Signal attenuates and becomes distorted when I probe at the ADC input while the Operational amplifier is connected to the ADC inputs
My question is what is the best way to drive the ADCs to achieve the best dynamics (the drivers in the reference designs also comes with problems and i could never achieve the Maximum dynamics without changing the gain numerically in the conversion function in the code above convert_mv() ), and why there is a mismatch between booth ADC's when working in Differential mode ?
Note : When I measure directly the resistance between AIN0 and AIN0GND its around 35 oms and For the AIN1 and AIN1GND it's around 140 ohms, why aren't they equal because i think that imbalance is the reason for gain mismatch between booth channels