chiark / gitweb /
watchdog seems to work; fix up memory clearing too
authorian <ian>
Fri, 30 Dec 2005 13:30:42 +0000 (13:30 +0000)
committerian <ian>
Fri, 30 Dec 2005 13:30:42 +0000 (13:30 +0000)
detpic/mascan.asm
detpic/morse.messages
detpic/nmra-stream.asm
detpic/program.asm
detpic/serout.asm
detpic/watchdog.asm

index f1b783aa5a85cd6a343a22b25f1391cb8d55b602..62e439729469dd7a3c5e83f2be6689beb17bdd6f 100644 (file)
@@ -234,7 +234,7 @@ nextslave_nowrite
        mov_lfsr slavetable, 1  ; FSR1H -> slavetable
        mov_ff  cslot, FSR1L    ; FSR1 -> new ste_flags
 
- panic morse_TI3
+ return
        bt_f_if1 POSTDEC1, stf_sentinel ; FSR1 -> ste_slave
        bra     nextslave_looparound
        ; Ok, we have a slave:
index a1a81e5ea3208199f36d391958302f3a4f6dbb5b..3966c7b4898b8b199a041d1dce8b905a3f70d25d 100644 (file)
 
 # Temporary entries for testing and development
 TM     PIE1,SSPSTAT,SSPCON1,SSPCON2 ; Master got I2C interrupt
+TI0                            ; for iwj
 TI1                            ; for iwj
 TI2                            ; for iwj
 TI3                            ; for iwj
 TI4                            ; for iwj
 TI5                            ; for iwj
+TI6                            ; for iwj
+TI7                            ; for iwj
+TI8                            ; for iwj
+TI9                            ; for iwj
 
 # Main message listing.  Kept sorted by section for easy reference.
 # -----------------------------------------------------------------
index 6caea1ee38292acaea2eb7270b049d141d5846fc..0421bfd58f9a4712137831d0e1c177d2ed90b02a 100644 (file)
@@ -212,8 +212,8 @@ nmra_restartmessage @       ; Entrypoint from power_polarising_tick, at end
 ;****************************************************************************
 
 nmra_sendwatchdog_start @
-       mov_lw  0x40
-       mov_wf  totrack
+       mov_lw  0x40    ; if we were in a message it's going to get
+       mov_wf  totrack ; garbled; oh well.
        return
 
 nmra_sendwatchdog_stop @
index 6ea0d8571667efee9c1eaac20727acf1f73016f2..239e2098eb27563df07c02d7ef8228bc54de3927 100644 (file)
@@ -9,24 +9,10 @@
 
 ;----------------------------------------
 vector_reset @
-
- set_f qqTRISA
- set_f qqTRISB
- set_f qqTRISC
- set_f qqTRISD
- set_f qqTRISE
- mov_lw 0xaa
- mov_wf qqLATA
- mov_wf qqLATB
- mov_wf qqLATC
- mov_wf qqLATD
- mov_wf qqLATE
-
        clr_f   INTCON
        bs_f    RCON, IPEN      ; interrupt priorities
 
        call    idlocs_init
-       clr_f   flags
 
        bt_f_if0 idloc1,idloc1_master
        call    slave_init
@@ -72,6 +58,7 @@ intrl_handled_routine @
 master_init
 ; Master-specific initialisation.
        call    memory_erase
+       clr_f   flags
        call    serial_init
        call    i2cm_init
        call    serialtxbuf_init
@@ -92,16 +79,19 @@ master_init
 ;----------------------------------------
 master_interrupt_low @
        enter_interrupt_low
+ D 0x80
        call    tick_intrl
+ D 0x01
        call    nmra_serialrx_intrl
+ D 0x02
        call    power_fault_intrl
- mov_ff PIR1, xdebug+2
- mov_ff PIE1, xdebug+3
- mov_ff IPR1, xdebug+4
- mov_ff INTCON, xdebug+5
+ D 0x03
        call    serialtxfc_intrl
+ D 0x04
        call    serialtx_intrl
+ D 0x05
        call    points_local_intrl
+ D 0x06
        call    i2cm_intrl
  bs_f  xdebug+0, 5
        panic   morse_IL
@@ -137,7 +127,7 @@ serialrx_if_multibyte
                goto    serialrx_bad            ; 1 0000 xxx
        goto    command_ping            ; 1 0001 xxx
        goto    command_polarity        ; 1 0010 xxx
-       goto    serialrx_bad            ; 1 0011 xxx
+       goto    command_watchdog        ; 1 0011 xxx
        goto    command_point           ; 1 0100 xxx
        goto    serialrx_bad            ; 1 0101 xxx
        goto    serialrx_bad            ; 1 0110 xxx
@@ -174,6 +164,8 @@ command_ping_bad panic morse_HP
 ;----------------------------------------
 slave_init
 ; Slave-specific initialisation.
+       clr_f   flags
+
        mov_fw  picno
        call    i2cs_init
 
index 85da2c746b0cafa7ac9875839173de83eaaca37b..f017701bca2603e9cbb3d1b17853d26a22c0d03e 100644 (file)
@@ -111,7 +111,7 @@ serialtx_intrl @
        bra_z   tx_bufempty
 
  mov_fw        INDF0
- xor_lw 0x02
+ xor_lw 0xbb
  bra_z boo
        mov_fw  INDF0
        mov_wf  TXREG
index f0abe6cbe02f95254b8de7d5b6d19824a7d90734..f4b34a4dbc9b47b4b08aa27f624b0a42170d10d8 100644 (file)
@@ -12,9 +12,9 @@ command_watchdog @
        mov_fw  POSTINC0        ; W =           10011OOO
        and_lw  0x07            ; W =           00000OOO
        bra_nz  command_watchdog_bad
-       mov_wf  INDF0           ; W =           OMMMMMMM
+       mov_fw  INDF0           ; W =           OMMMMMMM
        bra_n   command_watchdog_bad
-       mov_fw  watchdog        ; watchdog =    OMMMMMMM
+       mov_wf  watchdog        ; watchdog =    OMMMMMMM
        goto    nmra_sendwatchdog_stop
 
 command_watchdog_bad panic morse_WX
@@ -23,6 +23,7 @@ command_watchdog_bad panic morse_WX
 watchdog_tickdiv @
        tst_f_ifnz watchdog
        dec_f_ifnz watchdog
+       return
        ; oops, we've timed out
 
        call    nmra_sendwatchdog_start
@@ -39,6 +40,8 @@ wdog_byte macro v
        mov_wf  POSTINC1
        endm
 
+       ; An extra idle byte:
+       set_f   POSTINC1        ; ff
        ; Baseline Broadcast stop Forwards(I) non-Emergency S9.2 B l.98-
        ; as computed by ./hostside-old -st bstop
        set_f   POSTINC1        ; ff