From: ian Date: Wed, 7 Dec 2005 19:50:09 +0000 (+0000) Subject: debugging wip (and strange debugging things) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=7df49af0497277ad020b78bc82352250df369443;p=trains.git debugging wip (and strange debugging things) --- diff --git a/detpic/points.asm b/detpic/points.asm index d39aa04..5609bad 100644 --- a/detpic/points.asm +++ b/detpic/points.asm @@ -149,33 +149,24 @@ points_local_init ;... points_init_byte_loop mov_lw 8 ; W = bit counter - clr_f PREINC0 ; FSR0 -> bit[current] := 0 tblrd_postinc_fixup ; TABLAT = bitmap data being processed ;... points_init_bit_loop + clr_f PREINC0 ; FSR0 -> bit[current] := 0 rrc_f TABLAT - bt_f_if1 STATUS,C set_f INDF0 ; FSR0 -still-> bit[current] := 0xff clr_f PREINC0 ; FSR0 -> LAT*[current] := 0 - dec_w_ifnz bra points_init_bit_loop dec_f_ifnz t bra points_init_byte_loop ;... end of loop: - return;qq - ; We've scanned for points used on this board; ; now find the actual pins. - mov_lfsr ptix2bitlat, 0 ; FSR0 -> this bit and LAT* - mov_lfsr bitnum2bit+7, 1 ; FSR1 -> bitnum2bit+7 - set_f FSR2H ; FSR2 -> some SFR, will point to LAT/TRIS - mov_ff BSR,FSR2H;qq - mov_lw bkptix2portnumbitnum & 0xff bt_f_if0 idloc1,idloc1_boarddet add_lw maxpoint @@ -184,6 +175,11 @@ points_init_bit_loop mov_lw bkptix2portnumbitnum >> 8 mov_wf TBLPTRH ; TBLPTR* -> point port/bit data + set_f FSR2H ; FSR2 -> some SFR, will point to LAT/TRIS + mov_ff BSR,FSR2H;qq + mov_lfsr bitnum2bit+7, 1 ; FSR1 -> bitnum2bit+7 + mov_lfsr ptix2bitlat, 0 ; FSR0 -> this bit (and LAT*) + mov_lw maxpoint mov_wf t ; t = loop counter ;... @@ -194,7 +190,7 @@ points_init_portbit_loop bra points_init_portbit_endif_used ;... points_init_portbit_if_used - mov_wf TABLAT + mov_fw TABLAT bra_n point_initing_bad_point and_wff FSR1L ; FSR1 -> bit value for bit @@ -205,8 +201,8 @@ points_init_portbit_if_used mov_wf POSTDEC0 ; LAT*[this] := LAT, FSR0 -> bit[this] mov_wf FSR2L ; FSR2 -> LAT* - mov_wf INDF1 ; W = bit - mov_fw POSTINC0 ; bit[this] = bit, FSR0 -> LAT*[this] + mov_fw INDF1 ; W = bit + mov_wf POSTINC0 ; bit[this] = bit, FSR0 -> LAT*[this] com_w ; W = ~bit and_wff INDF2 ; LAT* &= ~bit, ie pin set to L (still Z) pin_vh pall_pt0reverse ; but pt0 pin is backwards, set to H @@ -220,6 +216,7 @@ points_init_portbit_if_used points_init_portbit_endif_used ; so now we move on to the next one mov_fw POSTINC0 ; FSR0 -> bit[this+1] + dec_f_ifnz t bra points_init_portbit_loop @@ -227,6 +224,30 @@ points_init_portbit_endif_used ;---------- point_initing_bad_point + panic morse_PF + mov_lw 0x11 + mov_wf POSTINC0 + mov_lw 0x22 + mov_wf POSTINC0 + mov_lw 0x33 + mov_wf POSTINC0 + + mov_ff t, POSTINC0 + + mov_lw 0x44 + mov_wf POSTINC0 + + mov_ff TBLPTRU, POSTINC0 + mov_ff TBLPTRH, POSTINC0 + mov_ff TBLPTRL, POSTINC0 + + mov_lw 0x55 + mov_wf POSTINC0 + + return;qq + + + panic morse_PF ;----------