Sheritronics
Newbie level 6
Need help! i have to generate 1sec overflow interrupt with timer1 in pic16f877a any special logic?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 if(TMR1IF == 1) // if overflows { variable++; // increments every 1ms if(variable == 1000) // when it reaches 1000ms i.e., 1 sec delay { seconds_variable++; // increment another variable variable = 0; // reset to 0 } } TMR1H = 0xEC; TMR1L = 0x77; TMR1IE = 1; TMR1IF = 0;