# HG changeset patch # User heinrichsweikamp # Date 1308507772 -7200 # Node ID ee5e1c65657c3520a611c68f857d89e4d8176918 # Parent a847f416e67e8f019ace67dc80c3b136d4542153 Debugging the TMR1... diff -r a847f416e67e -r ee5e1c65657c code_part1/OSTC_code_asm_part1/isr.asm --- a/code_part1/OSTC_code_asm_part1/isr.asm Sun Jun 19 14:20:19 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/isr.asm Sun Jun 19 20:22:52 2011 +0200 @@ -176,22 +176,21 @@ ; timer1int: - bcf PIR1,TMR1IF ; Clear flag - timer1int_debug: bcf LED_red ; LEDr off (For charge indicator) -; movlw 0x08 ; Timer1 int after 62.5ms (=16/second) -; cpfslt TMR1H ; Did we miss a 1/16 second? -; incf timer1int_counter1,F ; Yes, add extra 1/16 second - btfsc TMR1L,0 ; Wait for low clock cycle bra $-2 - btfss TMR1L,0 + btfss TMR1L,0 ; Still high? bra $-2 ; max. loop time: 61µs movlw 0x08 ; Timer1 int after 62.5ms (=16/second) + cpfslt TMR1H ; Did we miss a 1/16 second? + incf timer1int_counter1,F ; Yes, add extra 1/16 second + + movlw 0x08 ; Timer1 int after 62.5ms (=16/second) subwf TMR1H,F + bcf PIR1,TMR1IF ; Clear flag incf timer1int_counter1,F ; Increase timer1 counter