Perhaps with a separate counter. Then just read the value of the count when
desired. Many micro's that I've seen include various commonly needed
'extras' such as this. If the signal is 'noisy' you may need to condition
the pulses somewhat before putting them to the clock input of a counter
(schmidt trigger comes to mind as one way, or a one-shot circuit to limit
the upper rate of triggering).
Some 'one-wire' devices do this and store the results internally. When
queried (over the serial line), they respond with a hex value.
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.