Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- irq movwf w_temp ; save state
- swapf STATUS, w
- clrf STATUS
- movwf status_temp
- movf PCLATH, w
- movwf pclath_temp
- clrf PCLATH
- btfss PIR1,TMR1IF ; timer1 IRQ?
- goto notimer1
- bcf PIR1,TMR1IF ; yes, clear it
- movLw T1SPEED >> 8 ; reset timer1
- movwf TMR1H
- movLw T1SPEED & 0xff
- movwf TMR1L ; timer1 is off and running again
- call timer ; increment clock
- notimer1 btfss INTCON, T0IF ; timer0 IRQ?
- goto notimer0
- bcf INTCON, T0IF ; yes, clear it
- call led_set ; update display
- btfss PORTA,6 ; button pressed?
- goto nobut
- clrf digit0 ; yes, reset clock
- clrf digit1
- clrf digit2
- clrf digit3
- nobut
- notimer0 movf pclath_temp, w ; restore state
- movwf PCLATH
- swapf status_temp, w
- movwf STATUS
- swapf w_temp, f
- swapf w_temp, w
- retfie
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement