Hi. I am trying to use the PIC18F24K22 to capture an input square wave by capturing its every rising edge. CCP2 (RB3) is configured to work with TImer1. The input is a 1MHz square wave. The Timer1 is set to work as Fosc/4 where Fosc is 16MHz. Even with Fosc/4=4MHz this should have been fast enough to capture the input period. I had even tried lowering the input square wave frequency to 100KHz. The same problem: The microcontroller is not capturing anything. What's wrong? Please see attached C file. thank you.
Attachments
-
944 bytes Views: 10