Quote:
Originally Posted by kamocat
How about a boolean latch function? I think this might be possible with the "time since last pulse" counter, but that would require storing how long ago the last pulse was. A latch function might be configurable for "a pulse at least this length" so it could be used on things like switches. (In this past year, it could be used for a kicker passing by a switch to determine if it is at or past the frame perimeter.)
|
You can use digital filtering to ensure the pulse is at least "x" long. Then you can use an event counter to count each one or an interrupt as Joe suggested. The counter could handle more than one event before being read by your code. The interrupt will give you the time the event happened, but not handle more than one without overwriting the older event. With DMA, you could get both the time and more than one, but there is only one DMA resource available.
-Joe