From a39826677a70daaafbe0b9b8a3e8d18472a29bce Mon Sep 17 00:00:00 2001 From: ceb Date: Fri, 8 Apr 2005 22:12:35 +0000 Subject: [PATCH] horrible evil icky debugging die die die --- cebpic/panic.asm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/cebpic/panic.asm b/cebpic/panic.asm index f88bcf8..ee93679 100644 --- a/cebpic/panic.asm +++ b/cebpic/panic.asm @@ -21,6 +21,7 @@ WREG2 equ 00h ; a 2nd working reg :-) WREG3 equ 01h ; a 3rd working reg :-) WREG4 equ 02h ; a 4th working reg :-) BLANK equ 03h ; register full of zeros +TESTFLASH equ 04h ; test LED flash pattern @@ -48,6 +49,11 @@ err_SOS equ 0 ; msg 0 = SOS ; VECTORS: special locations, where the PIC starts executing ; after interrupts + + org 0 + goto vector_reset + + ; high priority interrupt ; ; org 000008h @@ -119,9 +125,9 @@ readout_loop readout_led_on bcf TRISD,2,0 ; make pin RD2 an output (DS100) ifbit0 WREG3,0 - bcf LATD,2,0 ; set LED red + bcf LATD,2,0 ; led red ifbit1 WREG3,0 - bsf LATD,2,0 ; set LED green + bsf TRISD,2,0 ; led black incf WREG4,1,0 ; increment loop counter call waiting goto readout_loop @@ -141,6 +147,9 @@ readout_led_off code ;**************************************************************************** + +vector_reset + ; serial set-up ; enable interrupts so that this can be used as a trigger for the ; panic routine @@ -222,6 +231,10 @@ informative_panic clrf INTCON,0 ; disable all interrupts EVER bcf PORTC,1,0 ; switch off booster + movlw 10101100b + movwf TESTFLASH + + ; re-initialise timer0 config bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode bcf T0CON,5,0 ; timer0 use internal clock @@ -233,8 +246,10 @@ informative_panic clrf BLANK,0 panic_loop ; errmsg err_SOS,RED ; transmit SOS in red - readout SSPCON1,RED ; transmit contents of SSPCON1 in red + readout TESTFLASH,RED ; transmit contents of SSPCON1 in red ; readout BLANK,RED ; transmit blank buffer + call led_green + call waiting goto panic_loop ;**************************************************************************** -- 2.30.2