Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20610

BASCOM-AVR : pulse length capture : REPLY

$
0
0
Cant help you on the overflow case till I look at it a bit more. But the assignment [code:1:2945b3e06b] dim I as word I = tcnt1 'or I = timer1 'or I - counter1 [/code:1:2945b3e06b] should all compile correctly, and read the timer1 current count. At least they do when I do it. Actually, for what you want, its better to read the value in capture1, since that is the value 'captured' by the interrupt at the edge of the pulse. You dont even have to do this in the ISR, just clear the timer count in there ready for the next edge. That still leaves the problem of handling the overflow, though.

Viewing all articles
Browse latest Browse all 20610

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>