comparison code_part1/OSTC_code_asm_part1/isr.asm @ 391:ee5e1c65657c 64kByte Logbook

Debugging the TMR1...
author heinrichsweikamp
date Sun, 19 Jun 2011 20:22:52 +0200
parents a847f416e67e
children 8e272339fb68
comparison
equal deleted inserted replaced
390:a847f416e67e 391:ee5e1c65657c
174 174
175 ;============================================================================= 175 ;=============================================================================
176 ; 176 ;
177 177
178 timer1int: 178 timer1int:
179 bcf PIR1,TMR1IF ; Clear flag
180
181 timer1int_debug: 179 timer1int_debug:
182 bcf LED_red ; LEDr off (For charge indicator) 180 bcf LED_red ; LEDr off (For charge indicator)
183 181
184 ; movlw 0x08 ; Timer1 int after 62.5ms (=16/second)
185 ; cpfslt TMR1H ; Did we miss a 1/16 second?
186 ; incf timer1int_counter1,F ; Yes, add extra 1/16 second
187
188 btfsc TMR1L,0 ; Wait for low clock cycle 182 btfsc TMR1L,0 ; Wait for low clock cycle
189 bra $-2 183 bra $-2
190 btfss TMR1L,0 184 btfss TMR1L,0 ; Still high?
191 bra $-2 ; max. loop time: 61µs 185 bra $-2 ; max. loop time: 61µs
186
187 movlw 0x08 ; Timer1 int after 62.5ms (=16/second)
188 cpfslt TMR1H ; Did we miss a 1/16 second?
189 incf timer1int_counter1,F ; Yes, add extra 1/16 second
192 190
193 movlw 0x08 ; Timer1 int after 62.5ms (=16/second) 191 movlw 0x08 ; Timer1 int after 62.5ms (=16/second)
194 subwf TMR1H,F 192 subwf TMR1H,F
193 bcf PIR1,TMR1IF ; Clear flag
195 194
196 incf timer1int_counter1,F ; Increase timer1 counter 195 incf timer1int_counter1,F ; Increase timer1 counter
197 196
198 movlw d'15' ; One second 16 197 movlw d'15' ; One second 16
199 cpfsgt timer1int_counter1 198 cpfsgt timer1int_counter1