comparison src/isr.asm @ 28:fcaf94b913db

rx isr
author heinrichsweikamp
date Sat, 20 Jul 2013 16:02:35 +0200
parents 11d4fc797f74
children bc6d47e801c6
comparison
equal deleted inserted replaced
27:a0fc5d6c207e 28:fcaf94b913db
34 34
35 HighInt: 35 HighInt:
36 movff PRODL,isr_prod+0 36 movff PRODL,isr_prod+0
37 movff PRODH,isr_prod+1 37 movff PRODH,isr_prod+1
38 38
39 ; INT3 for RX control
40 btfsc INTCON3,INT3IF ; Timer3 INT
41 rcall isr_int3
42 ; Timer0 for RX timing
43 btfsc INTCON,TMR0IF ; Timer0 INT
44 rcall timer0int
45
39 ; Pressure sensor and others 46 ; Pressure sensor and others
40 btfsc PIR5,TMR7IF ; Timer 7 47 btfsc PIR5,TMR7IF ; Timer 7
41 rcall isr_tmr7 ; Every 62,5ms 48 rcall isr_tmr7 ; Every 62,5ms
42
43 ; Timer0 for RX timing
44 ; btfsc INTCON,TMR0IF ; Timer0 INT (Button Debounce Timer)
45 ; rcall timer0int
46 49
47 ; Buttons 50 ; Buttons
48 btfsc PIR1,TMR1IF ; Timer1 INT (Button hold-down Timer) 51 btfsc PIR1,TMR1IF ; Timer1 INT (Button hold-down Timer)
49 rcall timer1int 52 rcall timer1int
50 btfsc INTCON,INT0IF ; Buttons 53 btfsc INTCON,INT0IF ; Buttons
66 movff isr_prod+0,PRODL 69 movff isr_prod+0,PRODL
67 retfie FAST ; Restores BSR, STATUS and WREG 70 retfie FAST ; Restores BSR, STATUS and WREG
68 71
69 ;============================================================================= 72 ;=============================================================================
70 73
71 ;timer0int: 74 timer0int:
72 ; bcf T0CON,TMR0ON ; Stop Timer 0 75 bcf T0CON,TMR0ON ; Stop Timer 0
73 ; return 76
74 ; 77 ; bcf LEDr;mH
75 ; movlw .240 78
76 ; movwf TMR0H 79 movlw TMR0H_VALUE
77 ; bcf INTCON,TMR0IF ; Clear flag 80 movwf TMR0H
78 ; clrf TMR0L 81 bcf INTCON,TMR0IF ; Clear flag
79 ; return 82 clrf TMR0L
80 83 bsf INTCON2,INTEDG3 ; INT3 on rising edge
84 return
85
86 isr_int3:
87 bcf INTCON3,INT3IF ; Clear flag
88 bsf T0CON,TMR0ON ; Start Timer 0
89 btg INTCON2,INTEDG3 ; Toggle INT3 edge
90
91 ; btg LEDr;mH
92
93 ; Reset RX Timeout
94 clrf TMR0L
95 movlw TMR0H_VALUE
96 movwf TMR0H
97 bcf INTCON,TMR0IF ; Clear flag
98 return
81 99
82 100
83 isr_uart2: ; IR-Link 101 isr_uart2: ; IR-Link
84 banksel RCREG2 102 banksel RCREG2
85 movf RCREG2,W 103 movf RCREG2,W