chiark / gitweb /
initial files (full of junky bits) for trackpower/cdu and actual master program
authorian <ian>
Sun, 18 Dec 2005 17:28:32 +0000 (17:28 +0000)
committerian <ian>
Sun, 18 Dec 2005 17:28:32 +0000 (17:28 +0000)
detpic/master.asm [new file with mode: 0644]
detpic/power.asm [new file with mode: 0644]

diff --git a/detpic/master.asm b/detpic/master.asm
new file mode 100644 (file)
index 0000000..6986573
--- /dev/null
@@ -0,0 +1,44 @@
+;======================================================================
+
+ include common.inc
+ code
+
+;----------
+; Program to implement the master.  Does not return.  Conditions on entry:
+;      interrupts              INTCON set up but interrupts disabled
+;      i2c controller          not set up / not enabled
+;      picno, idloc1           containing correct values read from flash
+
+master
+       call    i2cm_init
+       call    bitnum2bit_init
+       call    points_local_init
+       call    polarity_local_init
+       call    detect_local_init
+
+       call    serial_init
+       call    serial_interrupts_init
+       call    nmra_init
+
+ fixme up to here
+
+       call    detect_slave_init
+
+       bs_f    INTCON, GIEH
+       bs_f    INTCON, GIEL
+
+       bt_f_if1 idloc1,idloc1_boarddet
+       goto    backgroundloop_detectors
+       goto    backgroundloop_reversers
+
+
+;----------
+master_interrupt_low
+       enter_interrupt_low
+       call    serialrx_intrl
+       call    serialtx_intrl
+       call    points_local_intrl
+       call    i2cm_intrl
+       panic   morse_IL
+
+ include final.inc
diff --git a/detpic/power.asm b/detpic/power.asm
new file mode 100644 (file)
index 0000000..1be9017
--- /dev/null
@@ -0,0 +1,14 @@
+;======================================================================
+
+power_on ???
+; from cebpic/nmra-stream.asm's setup
+       bcf     PORTB,2,0       ; booster shutdown L
+       bcf     TRISB,2,0       ; booster shutdown not-Z
+
+       bcf     PORTB,0,0       ; user fault L or Z
+
+
+master_interrupt_high
+; either booster timer interrupt or short circuit
+       fixme   check short circuit
+       call    nmra_interrupt_timer