ESR meter with Arduino

Hi all,

Since I do not have an Arduino, I have built szmeu's original circuit around an Atmega8.
The only difference is that I'm using 1N5821 instead of 1N5822.
The firmware has been adapted from Totoro's code.
When connecting a cap or small resistor across pins 1+2 and GND, I'm getting nothing, the ADC value is always 0. (2.56V internal reference)
However, when connecting a potentiometer accross +5V and GND with the wiper going to the ADC (ADC0/PC0 in my case), I'm getting values, so the ADC seems to be working ok.
Charging pulses are generated, measuring about 30mV pp at pins 1+2 (maybe too low?)
Any pointers as to what could be wrong?