Hi,
Depends.....on what resolution you need, what else the PIC needs to do WHILE it times and counts pulses, if the PIC needs to other things while WAITING for that first signal to go high or if it can just sit there twiddling its thumbs, waiting, if you're "locked" to a specific chip, if the pulses are occuring even when the "solid" signal is NOT on etc etc etc etc.
I'd look at a chip that incorporates the TMR1 Gate feature or wire up a bit of external logic that gates the pulses so that they are presented to the PIC only when the "solid" signal is HIGH (a simple AND gate). Set a Timer up as a counter, connect the pulsed signal to its input. Connect the "solid" signal to another input. Clear the counter. Do a PULSIN measurement on the "solid" signal, grab the counter value. Something like that perhaps.
/Henrik.




Bookmarks