Skip Navigation
USGS - science for a changing world

Woods Hole Coastal and Marine Science Center

Skip Navigation

Sediment Transport Instrumentation Facility - Publications


 
  

Benthic Acoustic Stress Sensor (BASS):
Electronics Check-Out Procedures

November 22, 1994

Marinna A. Martini, U.S. Geological Survey
Albert Williams III, Woods Hole Oceanographic Institution

U.S. Geological Survey Open File Report OF-93-722

 

Appendix C. A Tattletale 4 BASS Program

1000 REM TT4 BASS PROGRAM FOR MONITORING BASS

1005 REM --- S1_LIT4.TTB

1010 X=0:A=0:B=0:C=0:D=0:E=0:F=0:G=0:H=0:REM ASSEMBLY ROUTINES

1015 PRINT #06H,A,B,C,D,E,F,G,H,X

1020 GOSUB 8000            :REM FIRST PASS

1025 PRINT #06H,A,B,C,D,E,F,G,H,X

1030 GOSUB 8000            :REM SECOND PASS

1031 PRINT #06H,A,B,C,D,E,F,G,H,X

1032 GOSUB 8000            :REM THIRD PASS

1035 PRINT #06H,A,B,C,D,E,F,G,H,X

1040 PCLR 7,8,9,10,11,12,13,14,15   :REM ESTABLISH DDRs

1050 ASM &HBB,DB &H02      :REM A/D BIPOLAR,TURNS OFF,12 BIT

1060 SLEEP 0               :REM START TIMER

1064 REM

1065 REM *******************MAIN LOOP*********************************

1066 REM

1075 REM IF PIN(0) = 1 GOTO 1080            :REM WAIT FOR START PULSE FROM BIG 6

1076 REM GOTO 1075

1080 RTIME                              :REM READ RTC

1090 X=0                                :REM INITIALIZE DATAFILE

1100 STORE X,#2,?(1)                    :REM MINUTES

1110 STORE X,#2,?(0)                    :REM SECONDS

1120 CALL &H7300,0                      :REM CALL A/D ROUTINE

1130 CALL &H73C0,0                      :REM CALL SUBTRACT AND TRANSFER

1140 X=0

1150 SLEEP 25             :REM WAIT 

1220 REM PRINT {4,20}

1225 PRINT #02,GET(X,#2),":",GET(X,#2),"    ";    :REM MM:SS

1230 FOR M=1 TO 2: FOR L=1 TO 4:REM PRINT IN READABLE ASCII

1240 PRINT #04,GET(X,#2)," ";

1250 NEXT L:PRINT "    ";

1255 NEXT M:PRINT

1260 GOTO 1075                :REM LOOP TO DO IT ALL AGAIN

1270 REM ****************** ASSEMBLER CODE *****************************

8000 X=&H7460           :REM MULTIPLEXOR LIST, NORMAL ORDER

8010 ASM X,DW &H0000;DW &H8000;DW &H4000;DW &HC000

8015 ASM X,DW &H2000;DW &HA000;DW &H6000;DW &HE000

8020 ASM X,DW &H0400;DW &H8400;DW &H4400;DW &HC400

8025 ASM X,DW &H2400;DW &HA400;DW &H6400;DW &HE400

8050 ASM X,DW &HFFFF;DW &HFFFF   :REM END OF LIST

8100 X=&H7300           :REM BASS ROUTINE

8110 ASM X,SLP             :REM START TIMING AT END OF SLP

8120 ASM X,LDAA &H17

8130 ASM X,ANDA #&H47

8140 ASM X,ORAA #&H40

8150 ASM X,STAA &H17       :REM PORT 6,0100 0XXX,PWR ON,/CS=1

8160 ASM X,LDX #&H7400     :REM INDEX TO MUX LIST AND OUTPUT

8170 ASM X,LDAB &H60,X

8180 ASM X,STAB &H03       :REM PORT 2

8190 ASM X,TAB

8200 ASM X,ORAB #&H08

8210 ASM X,STAB &H17       :REM CLOCK HIGH,0100 1XXX

8220 ASM X,STAA &H17       :REM 1st FALLING EDGE

8230 ASM X,STAB &H17

8240 ASM X,STAA &H17       :REM 2nd FALLING EDGE,ACCEPTS /CS=1

8250 ASM X,ANDA #&HBF      :REM 0000 0XXX ACCA

8260 ASM X,ANDB #&HBF      :REM 0000 1XXX ACCB

8270 ASM X,STAB &H17       :REM /CS=0

8280 ASM X,STAA &H17       :REM 1st FALLING EDGE

8290 ASM X,STAB &H17

8300 ASM X,STAA &H17       :REM 2nd FALLING EDGE,ACCEPTS /CS=0

8310 ASM X,SLP             :REM 42us USED OF 10ms

8320 ASM X,LDAA #&HE4      :REM RESET BURST GENERATOR

8330 ASM X,STAA &H03       :REM ADDRESS LAST AXIS

8340 ASM X,OIM &H01,&H15;OIM &H01,&H15 :REM P50=1, LONG PULSE

8350 ASM X,AIM &HFE,&H15   :REM P50=0

8360 ASM X,LDAB #&H02

8370 T=X                :REM TEST LOOP

8380 ASM X,BITB &H15       :REM TEST STROBE

8390 ASM X,BEQ T

8395 L=X             :REM A/D LOOP

8400 ASM X,LDAA &H60,X  :REM LOAD MUX,START OF A/D LOOP

8410 ASM X,STAA &H03       :REM MUX WORD

8420 ASM X,LDAA #&H86      :REM 1000 0110 BYTE INTO A/D

8430 ASM X,CLRB

8440 ASM X,PSHX

8450 ASM X,LDX #&H000C     :REM 12 BITS

8460 T=X                :REM A/D SERIAL I/O LOOP

8470 ASM X,AIM &HF7,&H17   :REM CLOCK LOW,BIT LOOP

8480 ASM X,ASLD            :REM BIT TO CARRY

8490 ASM X,BCC A

8500 ASM X,OIM &H10,&H17   :REM "1"

8510 ASM X,BRA B

8520 A=X

8530 ASM X,AIM &HEF,&H17   :REM "0"

8540 B=X

8550 ASM X,TIM &H20,&H17   :REM READ Dout

8560 ASM X,BEQ C           :REM IF "0",WRITE NOTHING,

8570 ASM X,INCB            :REM ELSE STORE "1"

8580 C=X

8590 ASM X,OIM &H08,&H17   :REM CLOCK HIGH

8600 ASM X,DEX

8610 ASM X,BNE T           :REM LOOP

8620 ASM X,SEI             :REM SET INTERRUPT MASK

8630 ASM X,OIM &H01,&H15   :REM START TIMING

8640 ASM X,OIM &H01,&H15   :REM P50=1,LENGTHEN PULSE

8650 ASM X,AIM &HFE,&H15   :REM P50=0

8660 ASM X,TIM &H04,&H15   :REM READ "BOTH REC" LAST VALUE

8670 ASM X,BEQ D  

8680 ASM X,ORAA #&H80      :REM NOT REC,FLAG WITH SIGN BIT

8682 D=X

8684 ASM X,BITA #&H08      :REM CHECK FOR NEGATIVE

8686 ASM X,BEQ H

8688 ASM X,ORAA #&H70      :REM FILL OUT NEGATIVE

8690 H=X

8700 ASM X,PULX            :REM CONTINUE,IF"BOTH",DON'T FLAG

8710 ASM X,STD &H00,X      :REM STORE AT DATA,FIRST BOGUS

8720 ASM X,INX:ASM X,INX   :REM INCREMENT TWICE

8730 ASM X,TIM &H01,&H5E,X :REM CHECK FOR END OF LIST

8740 ASM X,BEQ E   

8750 ASM X,CLI             :REM CLEAR INTERRUPT MASK

8760 ASM X,CLRA

8770 ASM X,STAA &H03       :REM PUT MULTIPLEXORS ON PARK

8780 ASM X,JSR &HFFD0      :REM CONOFF TURN POWER OFF

8790 ASM X,RTS             :REM EXIT FROM DIGITIZE ROUTINE

8800 E=X

8810 ASM X,LDAA &H17       :REM PREPARE TO RESPOND FAST

8820 ASM X,ANDA #&HE7

8830 ASM X,LDAB #&H02

8840 T=X                :REM TEST LOOP

8850 ASM X,BITB &H15       :REM TEST A/D STROBE

8860 ASM X,BEQ T

8870 ASM X,STAA &H17       :REM HOLD WITH FALLING EDGE

8880 ASM X,CLI             :REM CLEAR INTERRUPT MASK

8890 ASM X,PSHX         :REM CONVERSION PART

8900 ASM X,LDX #&H0019     :REM 25,1st 2 FOR DEGLITCH

8910 ASM X,ORAA #&H40      :REM /CS=1

8920 ASM X,TAB

8930 ASM X,ORAB #&H08      :REM 0100 1XXX

8940 T=X                :REM LOOP

8950 ASM X,STAB &H17       :REM 0100 1XXX

8960 ASM X,STAA &H17       :REM 0100 0XXX

8970 ASM X,STAB &H17

8980 ASM X,STAA &H17

8990 ASM X,DEX

9000 ASM X,BNE T           :REM 50 CYCLES,12x4+2

9010 ASM X,ANDA #&HBF      :REM 0000 0XXX

9020 ASM X,ANDB #&HBF      :REM 0000 1XXX

9030 ASM X,STAB &H17       :REM /CS=0

9040 ASM X,STAA &H17       :REM 1st FALLING EDGE

9050 ASM X,STAB &H17

9060 ASM X,STAA &H17       :REM 2nd FALLING EDGE

9070 ASM X,PULX

9080 ASM X,JMP L           :REM RETURN TO START

9090 G=X

9100 X=&H73C0           :REM SUBTRACT AND TRANSFER SUBROUTINE

9110 ASM X,LDX #&H7400

9120 L=X

9130 ASM X,LDD &H02,X     :REM GET WORD

9140 ASM X,INX:ASM X,INX

9150 ASM X,BMI F           :REM TEST FLAG ON NORMAL MEAS

9160 ASM X,SUBD &H02,X     :REM DOUBLE SUBTRACT

9170 ASM X,TST &H02,X      :REM TEST FLAG ON REVERSED MEAS

9180 ASM X,BMI F

9200 ASM X,STAB &H02,X     :REM SAVE LOW BYTE

9202 ASM X,ASLA            :REM TEST FOR NEGATIVE

9204 ASM X,ASRA            :REM FILL WITH WHATEVER IT IS

9206 T=X

9210 ASM X,JSR &HFFD3      :REM STRMEM HIGH BYTE

9220 ASM X,LDAA &H02,X     :REM RECOVER LOW BYTE

9230 ASM X,JSR &HFFD3      :REM STRMEM LOW BYTE

9240 ASM X,INX:ASM X,INX

9250 ASM X,TIM &H01,&H60,X :REM CHECK END OF LIST

9260 ASM X,BEQ L

9270 ASM X,RTS             :REM EXIT

9280 F=X

9290 ASM X,LDAA #&H80      :REM FLAG MISSED RETURN

9300 ASM X,CLR &H02,X      :REM CLEAR LOW BYTE

9310 ASM X,BRA T

9900 RETURN

9999 END




Back to contents - Previous section - Next section



Skip Navigation

Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USAGov logo U.S. Department of the Interior | U.S. Geological Survey

URL: woodshole.er.usgs.gov/operations/stg/Pubs/bass/appenc.html
Page Contact Information: WHSC Webmaster
This page last modified on Monday, 24-Nov-2014 13:06:01 EST