Greetings,

I have a project where i need to check 2 inputs but i have no clue how to do it... i will try to explain.

--What i have--
Both signals start and end at the same time
One changes to high and stays high until the end
The second has pulses

--what i need--
I need to count the number of pulses of the second input while the first input is on.
The pulses ( high state ) are 35ms long but the low state may vary
I also need to count how long is the first at the high state

--math after input receive--
I then need to compare the lenght of the first input and the number of pulses detected so i can check if there are any missed pulses.


The math i can handle...what i cant figure out is how can i measure the time of a pin being high and at the same time count the pulses of the second pin.

I thank in advance the help.

Regards
Rui