;======================================================================
code
+;----------
+det_common_setup
+ mov_lw 0b111 ; turn off comparator, or we can't use pins
+ mov_wf CMCON ; RD0-RD4 as digital inputs
+ mov_lw 0b0110 ; turn off A/D except perhaps for pin
+ or_wff ADCON1 ; AN0 ie SPARE ie RA0 (same reason as above)
+ return
+
;----------
det_slave_setup
+ bsr det_common_setup
set_f scana
set_f scanb
set_f scanc