Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 63713

Forum Post: RE: Debounce program using RTC timer

$
0
0
There's a similar case with the RTCIFG: You should clear the IFG before you start waiting for the RTC: RTCIV = RTCIV_RTCIF ; // clear stale IFG = 1", in case the switch bounces very fast. (b) The counter_timer test should also be ">=", though you're much less likely to trip over that one. (c) After the timeout, you should clear the counters after clearing RTCIE (and before setting P2IE), in case one more interrupt sneaks in in between and throws counter_timer off.

Viewing all articles
Browse latest Browse all 63713

Trending Articles



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