The comparator(and C10) is essentially there
No.
Where should the µC know C from?
The meter you are trying to build does not measure ESR: it provides an indication of ESR, in conjunction with a known C.
Anyhow, can I improve my software solution or do I require two interrupts, without changes to the way the measurement is done?
Yes. This would be what I would do:
- measure the voltage on the capacitor, V0;
- charge up the capacitor for a known period of time, Tc;
- measure the voltage on the capacitor, V1; C = (V1-V0) / (I * Tc);
- discharge the capacitor for a known period of time, Td;
- measure the voltage, V2: V2 = V1 * exp (-Td / (ESR * C)), solve for ESR.
Done.
It uses the same hardware.