I have a 3.3V PWM signal going to a PIC18F45K20 that I would like to simply detect. I don't need to measure frequency or duty cycle. I'm thinking that what would work best is to call a function that would just return a YES or NO boolean value if the PWM is there or not, respectively.
I've thought about using interrupts, but I can't think of a decent solution. I can't use the CCP modules (they're not available). I'm sure there's a way to do it, I just can't think of a good way to go about it. Maybe detect a rising edge and a falling edge and if both exist, then my value is YES. But then it has to remain in the function long enough for a rising and falling edge to be detected...
Gah. Any ideas?
I've thought about using interrupts, but I can't think of a decent solution. I can't use the CCP modules (they're not available). I'm sure there's a way to do it, I just can't think of a good way to go about it. Maybe detect a rising edge and a falling edge and if both exist, then my value is YES. But then it has to remain in the function long enough for a rising and falling edge to be detected...
Gah. Any ideas?