Jump to content
 

Leaderboard


Popular Content

Showing content with the highest reputation since 05/15/2019 in all areas

  1. 2 points
    Remember, this timer counts up.and you get the interrupt when it rolls over. To interrupt at a precise interval, you must compute the number of "counts" required for that interval and then subtract from 65535 to determine the timer load value. void setTimer(unsigned int intervalCounts) { TMR1ON = 0; TMR1 = 65535 - intervalCounts; TMR1ON = 1; } By turning the timer off and then setting the counts and restoring the timer, you can be sure that you will not get unexpected behavior if the timer value is written in an unexpected order. I will cover this topic in the next blog post on timers.
 


  • Newsletter

    Want to keep up to date with all our latest news and information?

    Sign Up
×
×
  • Create New...