This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to count pulses?

I am giving 2 signals to the controller.
1st signal to port 3.4
and 2nd to port 3.5.
now these signals are continuously being fed to the port pin..

1st signal has the following patern
011001101100110110011.......(0110011 pattern is repeating again and again.entire duration of 0110011 is 14ms)

2nd signal has the following patern
011010101101010110101.......(0110101 pattern is repeating again and again.entire duration of 0110101 is 14ms)

my task is to count the number of one's (high) in 14 ms..
Then i should put this in while loop bcoz unique pattern of 14ms is repeating again and again...

How should i proceed?

I have two options in hardware-either i can give my 2 signals to timer port3.4 or 3.5

or to give it to gpio

pls help

0