Hi,
I am working on PIC18F4520.
I have a signal on PIN RB2 whose frequency is 120Hz, pulse width 230 us(approx.) and time between falling edge and next rising edge is about 200 ms.
I have to read this signal and check whether it has the above specifications or not.
how to do this..?????
Hi,
I am working on PIC18F4520.
I have a signal on PIN RB2 whose frequency is 120Hz, pulse width 230 us(approx.) and time between falling edge and next rising edge is about 200 ms.
I have to read this signal and check whether it has the above specifications or not.
how to do this..?????
The common method is on rising edge to start a counter (timer in counter mode) and to stop the counter on falling edge. The count * period of the clock is the period of your pulse.
You can use PORTB interrupt to start and stop the counter.