SHARE
TWEET

Untitled

a guest Jun 25th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void interrupt tc_int(void)             // High priority interrupt
  2. {
  3.     if (TMR1IE && TMR1IF)
  4.     {
  5.         TMR1IF=0;
  6.         ++tick_count;
  7.         TRISC=1;
  8.         LATCbits.LATC4 = 0x01;
  9.     }
  10. }
  11.  
  12. void interrupt low_priority   LowIsr(void)    //Low priority interrupt
  13. {
  14.     if(INTCONbits.T0IF && INTCONbits.T0IE)  // If Timer flag is set & Interrupt is enabled
  15.     {                              
  16.         TMR0 -= 250;                    // Reload the timer - 250uS per interrupt
  17.         INTCONbits.T0IF = 0;            // Clear the interrupt flag
  18.         ADCON1=0x0F;
  19.         TRISB=0x0CF;
  20.         LATBbits.LATB5 = 0x01;          // Toggle a bit
  21.     }
  22.     if (TMR1IE && TMR1IF)
  23.     {
  24.         TMR1IF=0;
  25.         ++tick_count;
  26.         TRISC=0;
  27.         LATCbits.LATC3 = 0x01;
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top