Advertisement
Lawrence_Woolmer

Interrupt Subroutine

Dec 4th, 2018
2,602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pic 16 0.43 KB | None | 0 0
  1. interrupt
  2.     clrf    PORTB       ;turn off all outputs (including LED)
  3.     call    tenthsec
  4.     call    tenthsec    ;wait a short time
  5.     bsf PORTB,6     ;illuminate LED - this will cause it to flash
  6.     call    tenthsec
  7.     call    tenthsec
  8.     btfss   PORTA,5     ;check if the interrupt reset is active
  9.     goto    interrupt   ;loop otherwise
  10.     bcf INTCON,1    ;disable the external interrupt flag
  11.     bcf PORTB, 6    ;clear the interrupt LED
  12.     retfie          ;return and enable global interrupt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement