Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. irq movwf w_temp ; save state
  2. swapf STATUS, w
  3. clrf STATUS
  4. movwf status_temp
  5. movf PCLATH, w
  6. movwf pclath_temp
  7. clrf PCLATH
  8.  
  9. btfss PIR1,TMR1IF ; timer1 IRQ?
  10. goto notimer1
  11. bcf PIR1,TMR1IF ; yes, clear it
  12.  
  13. movLw T1SPEED >> 8 ; reset timer1
  14. movwf TMR1H
  15. movLw T1SPEED & 0xff
  16. movwf TMR1L ; timer1 is off and running again
  17.  
  18. call timer ; increment clock
  19.  
  20. notimer1 btfss INTCON, T0IF ; timer0 IRQ?
  21. goto notimer0
  22. bcf INTCON, T0IF ; yes, clear it
  23.  
  24. call led_set ; update display
  25.  
  26. btfss PORTA,6 ; button pressed?
  27. goto nobut
  28. clrf digit0 ; yes, reset clock
  29. clrf digit1
  30. clrf digit2
  31. clrf digit3
  32. nobut
  33. notimer0 movf pclath_temp, w ; restore state
  34. movwf PCLATH
  35. swapf status_temp, w
  36. movwf STATUS
  37. swapf w_temp, f
  38. swapf w_temp, w
  39. retfie
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement