trying to use interrupt on port pin to toggle a led & when i run the code the led stays on , i increase the counter to 50 & the led stays off i can't seem to figure out whats wrong in the code or what i'm doing wrong
unable to toggle a led on port pin using interrupt, went through code & can't find the problem
Code (C):
- // pic 18f2500
- // pckit2 programmer
- // MikrocPro compiler
- int counter ;
- void interrupt (){
- INTCON.GIE = 0; // disable global interrupt
- if (INTCON.TMR0IF == 1) // if TMR0IF overflow
- {
- count ++; // increment overflow...