panic_loop
goto panic_loop
+
+
+;----------------------------------------
+informative_panic
+; switch off interrupts and power
+; reconfigure timer0 for writing diagnostic msg to the LED
+;
+ clrf INTCON,0 ; disable all interrupts EVER
+ bcf PORTC,1,0 ; switch off booster
+
+; re-initialise timer0 config
+ bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode
+ bcf T0CON,5,0 ; timer0 use internal clock
+ bcf T0CON,3,0 ; use prescaler
+ bsf T0CON,2,0 ; }
+ bcf T0CON,1,0 ; } prescale value 1:32 (13ms x 32)
+ bcf T0CON,0,0 ; }
+
+;
+
+
+
+
+;----------------------------------------
+waiting
+; wait for timer0 interrupt
+ bcf INTCON,2,0 ; clear timer0 interrupt bit (p109)
+ clrf TMR0H,0 ; p107 set high bit of timer0 to 0 (buffered,
+ ; only actually set when write to tmr0l occurs)
+ clrf TMR0L,0 ; set low bit o timer0 - timer now set to 0000h
+loop
+ btfss INTCON,2,0 ; check whether timer0 interrupt has been set -
+ ; skip next instruction if so
+ bra loop
+ return
+
+
;****************************************************************************
end