From: ian Date: Sun, 18 Dec 2005 17:28:32 +0000 (+0000) Subject: initial files (full of junky bits) for trackpower/cdu and actual master program X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=3114b90da9a1010077a3308ae31724c4114c0894;p=trains.git initial files (full of junky bits) for trackpower/cdu and actual master program --- diff --git a/detpic/master.asm b/detpic/master.asm new file mode 100644 index 0000000..6986573 --- /dev/null +++ b/detpic/master.asm @@ -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 index 0000000..1be9017 --- /dev/null +++ b/detpic/power.asm @@ -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