chiark / gitweb /
shut down comparators and A/D converter
authorian <ian>
Fri, 2 Dec 2005 02:48:57 +0000 (02:48 +0000)
committerian <ian>
Fri, 2 Dec 2005 02:48:57 +0000 (02:48 +0000)
detpic/detect.asm

index fd0a9ac43bc40238fb89d2dfd809fb9768ea6edf..8709db43ed7690af9ed67d44b2c754ace48b4957 100644 (file)
@@ -54,8 +54,17 @@ message_buffer_end
 ;======================================================================
        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