Pin input analog to digital signal detection
I have an AC source which I've cleaned and limited via a capacitor and resistor. It offers the signal you can see on the oscilloscope. Normally I'd run it through a comparator however I've used all 4 on-board ones up and there's no floorspace for an external. There is a zener clamp on the PIC input side and the pin protection diodes are being used as you can see in the display. Current is very minimal, less than 1mA so no problem here.
I hook the signal into a JK set to flip-flop and output onto an LED. At 15.5Hz I should see a pattern of 7.25Hz roughly on the LED. In fact, the pattern is completely random, so it's not working as I'd like.
I've played with setting the pin into TTL and ST modes. I suspect that the PIC's pin can't handle the slew rate of the signal, otherwise I'm out of ideas?