The ADC software I previously wrote works fine for the project but now I need to be able to count the pulses of the same signal going into the ADC.
I need to count the positive pulses during a given time window as defined in software to determine if the frequency of the ADC input has shifted.
I have an extra port pin PORTB4 and was wondering if I could simply couple the ADC input at PORTB3 to PORTB4 with, say, a 1K resistor, and count the 1's I see.
I can't see any way to do a ADC read over and over because the ADC input rarely goes to ground but it does have a peak voltage that flutters up and down slightly.
I assume I could bias the extra port input in such a way that anything over a certain voltage, the ADC input never goes all the way to 5V, equals a 1.
Any comments or suggestions would be appreciated.