2011-10-22 11:31 AM
.ExternalClass8CE9ECEBE1E84036AC5D7158FC9B07F8 p {margin-bottom:0.08in;}
The goal is to measure durations between input captures that exceed the 16 bit counter range by adding counter overflows. There appears to be no way to cleanly do this. The basic problem is that clearing the update-event interrupt flag is a read-modify register-write type of operation. During that short window a signal that causes an input capture will turn on the input capture flag, and then have it immediately reset by the write operation that is clearing the update-event flag. The result is that an input capture interrupt follows, but there will be no flag set.
This situation is rare, but I have caught instances of it happening. In my particular case I am able to treat an input capture interrupt with no flag set the same as if the flag were set and the results are correct, however in the general case this would not work when more that one input capture in a timer was being used as the routine would not be able to tell which channel was the cause of the flagless interrupt. Is the some way around this problem? Might DMA avoid the problem, (if the DMA channels are not tied up!)? #input-capture #timer2011-10-23 02:45 PM
2011-10-25 08:19 AM
2011-10-25 08:24 AM