When you are done, come back and we can compare notes then.
You know the schematic, and the code is pretty easy
ISR(TIMER2_COMPA_vect){ // every 500µs
bitWrite(PORTD, 3, 0); // Disable discharge
bitWrite(PORTD, measurementRange, 0); // Pulse
delayMicroseconds(7); // The pulse width should be around 8µs
bitWrite(PORTD, measurementRange, 1); // Stops the pulse
bitWrite(PORTD, 3, 1); // Enable discharge
}
ISR(ANALOG_COMP_vect){ // Comparator interrupt
compareCounter++;
}
In the lowest range, every pulse is 10mΩ. In the middle range 100mΩ and 1Ω in the high range.