Hi,
For a LiIon voltage measurement you need:
* a voltage measurement with good (<1% error) absolute accuracy
* not big analog bandwidth (<10 Hz)
* not high sampling rate (<20 smpls/s)
To 1)
For good accuracy i recommend a differential measurement with internal reference (instead of vcc as ref)
I don't really remember, but is the only selectable internal voltage reference 1.1V? Isn't there a 2.5V one?
Then you need a voltage divider for each cell joint, and the upper and lower end.
It depends on total battery voltage. But since you don't need high sampling rate you could use a high ohmic voltage divider combined with a capacitor as low pass filter. When you have 4 cells you need 5 voltage dividers.
Try 200k, 10k and a 1uF capacitor in parallel to 10k. Connenct the capacitor next to the ADC with short wide traces to AGND a nd the ADC input. This gives a nominal input range of 0...23.1V. I don't know if this fits your application, adjust it. With a 10 bit ADC you will get a resolution of about 23mV per Lsb. This should be sufficient even when measuring a single cell.
Add a capacitor for Vref to the according pin and AGND.
Choose a fixed defined sampling rate using timers and interrupts.
100 samples per second should be enough. Multiplexing the channels..
* The higher the sampling rate the worse the accuracy, because of the capacitive effect of the sample and hold capacitor of the SAR ADC.
* Maybe Vref is really 1.085V. But it should not significantely change with time and temperature. To compensate the error a simple multiplication fir calibration in software should work. No big challenge. If you don't want to a independent calibration you need a higher accuracy external Vref. Use a 2.5V one or a 3.0V one, adjust the voltage divider for input range.
Please -especially with high ohmic voltage divider - don't use ADC sample control in main loop with unequal timing, this gives jumps in voltage readings.
With fixed ADC timing you could use a simple digital low pass filter for each ADC channel. This could improve voltage readings when you encounter noisy readings. But with the given setup there should be stable readings down to +/- 1 LSB. Within the ADC isr you should store the independent channel values in independent variables, so that you always and continously have reliable data available in the main loop. Mind "atomic" access to the data in main loop.
Processing the data in main loop should also be done sychronously to sampling rate, but this is not that important...
So far so good. Try this and tell us your experience.
For further discussion a simple schematic of your configuration would help. Also important values like cell count and cell voltage and so on...
I don't think you need OPAMPs.
Btw. All the wires from battery to voltage divider must not carry power current. Therfore you need independent lines for power and voltage sense.
Good luck
Klaus