From c0fb56db1d6dc1508604a4251a92c8f75343299e Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 2 Dec 2005 01:30:51 +0000 Subject: [PATCH] points wip --- detpic/common.inc | 12 ++++++++++++ detpic/pindata.inc | 19 +++++++++++++++++++ detpic/points.asm | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 detpic/pindata.inc create mode 100644 detpic/points.asm diff --git a/detpic/common.inc b/detpic/common.inc index 31916f4..69dfd07 100644 --- a/detpic/common.inc +++ b/detpic/common.inc @@ -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 index 0000000..cba20d7 --- /dev/null +++ b/detpic/pindata.inc @@ -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 index 0000000..20d72a6 --- /dev/null +++ b/detpic/points.asm @@ -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. + -- 2.30.2