I'm sitting here experimenting with a tiny13 based circuit for reading a capacitive sensor. The principle is: discharge the capacitor, then start charging through a resistor and start a timer, and finally read the timer when the capacitor voltage reaches the threshold value.
Originally I used the comparator to determine when the threshold is reached. A voltage divider to one comparator input, and the capacitor to the other. Worked quite nicely. But I also want to use the PWM outputs, which happen to be connected to the same pins as the comparator inputs. So, I had a look at the input pin characteristics in the datasheet, which indicated a nice low/high threshold at about half the supply voltage. I redesigned the circuit a bit, and just used an ordinary digital input to determine the capacitor threshold (poll the pin and stop the timer when it goes high). And it seems to work just fine! Any experiences or comments to such an approach? (And yes, it's just a personal hobby project).