chiark / gitweb /
points wip
authorian <ian>
Fri, 2 Dec 2005 01:30:51 +0000 (01:30 +0000)
committerian <ian>
Fri, 2 Dec 2005 01:30:51 +0000 (01:30 +0000)
detpic/common.inc
detpic/pindata.inc [new file with mode: 0644]
detpic/points.asm [new file with mode: 0644]

index 31916f4d803dcb5288a66e05a2541446cb69e651..69dfd07e90f1e19d01d3c26d0987b184124291c0 100644 (file)
@@ -14,6 +14,18 @@ clock equ -1
        include         ../iwjpictest/clockvaries.inc
        include         variables+vars.inc
 
+;----------------------------------------------------------------------
+; Common conventions for function register notation:
+; NOTE THAT THIS IS WRONG FIXME FIXME
+AND CHECK IT FIXME
+;                      Master                  Slave
+;   W                  Trashed                 Trashed
+;   STATUS             Trashed                 Trashed
+;   BSR                        Not used                Not used
+;   TBLPTR*,TABLAT     Reserved for ISR/init   Not used except init
+;   FSR0               Reserved for ISR/init   Reserved for ISR/init
+;   FSR1, FSR2         Trashed                 Reserved for I2C
+
 ;----------------------------------------------------------------------
 ; MACROS
 
diff --git a/detpic/pindata.inc b/detpic/pindata.inc
new file mode 100644 (file)
index 0000000..cba20d7
--- /dev/null
@@ -0,0 +1,19 @@
+;======================================================================
+
+pt_pic_data            equ     0x5000
+pt_port_data           equ     0x5100
+pt_bit_data            equ     0x5200
+
+pt_num_max             equ     255
+
+sense_pic_data         equ     0x5400
+sense_port_data                equ     0x5500
+sense_bit_data         equ     0x5600
+
+sense_num_max          equ     255
+
+reverse_pic_data       equ     0x5800
+reverse_port_data      equ     0x5900
+reverse_bit_data       equ     0x5a00
+
+reverse_num_max                equ     255
diff --git a/detpic/points.asm b/detpic/points.asm
new file mode 100644 (file)
index 0000000..20d72a6
--- /dev/null
@@ -0,0 +1,40 @@
+;======================================================================
+; POINTS
+
+ udata_acs
+point res 1
+
+ code
+
+obj_set_up_start macro
+       clr_f   TBLPTRU
+       clr_f   TBLPTRL
+       endm
+
+obj_select macro
+;      W       object number           -
+       mov_wf  TBLPTRL
+       endm
+       
+obj_setfsr0 macro obj_pic_data, obj_port_data, obj_bit_data, PORTRISLATA
+       mov_lw  pt_pic_data >> 8
+       mov_wf  TBLPTRH
+       
+
+;----------------------------------------------------------------------
+points_init
+; Clears TRIS* bits for all points and sets the
+; pin to `not triggering'
+
+       mov_lw  pt_num_max
+       mov_wf  point
+
+       obj_set_up_start
+
+points_init_loop
+       
+
+;----------------------------------------------------------------------
+cdu_init
+; For master pic only.  Sorts out the CDU's pin.
+