Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/isr.asm @ 390:a847f416e67e 64kByte Logbook
Debugging timer1
author | heinrichsweikamp |
---|---|
date | Sun, 19 Jun 2011 14:20:19 +0200 |
parents | cf1023a53d0c |
children | ee5e1c65657c |
comparison
equal
deleted
inserted
replaced
389:a59532d2daf8 | 390:a847f416e67e |
---|---|
179 bcf PIR1,TMR1IF ; Clear flag | 179 bcf PIR1,TMR1IF ; Clear flag |
180 | 180 |
181 timer1int_debug: | 181 timer1int_debug: |
182 bcf LED_red ; LEDr off (For charge indicator) | 182 bcf LED_red ; LEDr off (For charge indicator) |
183 | 183 |
184 movlw 0x08 ; Timer1 int after 62.5ms (=16/second) | 184 ; movlw 0x08 ; Timer1 int after 62.5ms (=16/second) |
185 cpfslt TMR1H ; Did we miss a 1/16 second? | 185 ; cpfslt TMR1H ; Did we miss a 1/16 second? |
186 incf timer1int_counter1,F ; Yes, add extra 1/16 second | 186 ; incf timer1int_counter1,F ; Yes, add extra 1/16 second |
187 | 187 |
188 ; movlw 0x10 ; Timer1 int after 62.5ms (=16/second) | 188 btfsc TMR1L,0 ; Wait for low clock cycle |
189 ; cpfslt TMR1H ; Did we miss another 1/16 second? | 189 bra $-2 |
190 ; incf timer1int_counter1,F ; Yes, add another extra 1/16 second | 190 btfss TMR1L,0 |
191 bra $-2 ; max. loop time: 61µs | |
191 | 192 |
192 movlw 0x08 ; Timer1 int after 62.5ms (=16/second) | 193 movlw 0x08 ; Timer1 int after 62.5ms (=16/second) |
193 subwf TMR1H,F | 194 subwf TMR1H,F |
194 | 195 |
195 incf timer1int_counter1,F ; Increase timer1 counter | 196 incf timer1int_counter1,F ; Increase timer1 counter |
397 movlw d'23' | 398 movlw d'23' |
398 cpfsgt hours | 399 cpfsgt hours |
399 return | 400 return |
400 clrf hours | 401 clrf hours |
401 incf day,F | 402 incf day,F |
402 movff time_correction_value,secs ; Correct too slow clock | 403 ; movff time_correction_value,secs ; Correct too slow clock |
403 | 404 |
404 check_date: | 405 check_date: |
405 movff month,isr_divB ; new month? | 406 movff month,isr_divB ; new month? |
406 dcfsnz isr_divB,F | 407 dcfsnz isr_divB,F |
407 movlw .31 | 408 movlw .31 |