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

BASCOM-AVR : pulse length capture : REPLY

$
0
0
Depending on which pins you have available, the T0 input for timer0 and T1 input for timer1 can serve for the purpose of counting an external frequency. If you start the timer when reading a high to low transition on the pin, then the timer will start counting with the next transition. Use the second timer to measure time. Read the timer after the determined time and calculate the frequency. If you just want the high or low time in a pulse, then just read the timer in a loop and count system clocks with the other. this seems to take a lot less time than an interrupt routine. Or monitor the pin directly and have a counter record the duration (simplest and just as accaurate). Hubert

Viewing all articles
Browse latest Browse all 20562

Trending Articles



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