Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4922

unable to toggle a led on port pin using interrupt, went through code & can't find the problem

$
0
0
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
Code (C):
  1. // pic 18f2500
  2. // pckit2 programmer
  3. // MikrocPro compiler
  4.  
  5. int counter ;
  6. void interrupt (){
  7. INTCON.GIE = 0;                   // disable global interrupt
  8. if (INTCON.TMR0IF == 1)      // if TMR0IF overflow
  9. {
  10. count ++;                              // increment overflow...
unable to toggle a led on port pin using interrupt, went through code & can't find the problem

Viewing all articles
Browse latest Browse all 4922

Trending Articles