As far as I can tell there is a lot of confusion on how the ADC gain stage in the xmega devices works, and I was wondering if anyone could help with a simple example .
My current example circuit is a microphone connected to a opamp with feedback to give a voltage gain of 64. This is then connected to a ADC of a MegaAVR. The microphone has a dc blocking capacitor and the single supply opamp using a half-bias to ensure that signal is in the middle of the rails. The ADC then samples the signal using VCC as Vref and I just subtract of the half-bias in software.
I would like to simplify this circuit by removing the opamp and using the Xmega 64x amplifier to directly connect to the microphone (I'm not too concerned about gain errors and noise at this point, I just want to prove that xmega gain stage can replace a typical opamp amplifier circuit)
My concern about this is that AVR1300: Using the Atmel AVR XMEGA ADC application note states:
Negative values are not negative inputs on the I/O pins, but higher voltage level on the negative input in respect to the positive input. Even though the resulting value can be negative, voltages below GND or above VCC should under no circumstances be applied to any input port.
This would mean that the DC blocked microphone signal would not satisfy this requirement as it would pull below GND.
Another application note Atmel AVR1631: Single Phase Energy Meter using XMEGA A states this:
Differential measurement with gain stage is available inside to XMEGA A4U microcontroller which increases the dynamic range. Hence external gain amplifier and level shifter for negative signal is not required. This will reduce the product cost.
So my question is can the ADC gain stage be used as "traditional" opamp circuit, where you apply the signal (even though it theoretically takes the pin negative) to the inverting or non-inverting port and then a "half-bias" (or whatever voltage makes sense with reference to Vref) to the other input to amplify the signal and measure it in signed mode?
Thanks for any help!