# Test and calibration code for WebTerminal V2 boards. # Connect RED LED ground to OP6 (TTL input high, A/D voltage too high) # Connect BLUE LED ground to OP8 (TTL input low, A/D voltage too low) # Connect GREEN LED ground to OP7 (TTL input test ok, A/D voltage within threshold) # Two additional LEDS ground to OP1 and OP2. # OP1 on, OP2 off = setting up AMP1 gain. Apply 1V, adjust for green. # OP1 off, OP2 on = setting up AMP2 gain. # OP1 on, OP2 on = setting up AMP3 gain. # OP1 flashing (1 to 8 times), OP2 off - testing TTL input X. # In input test mode, connect OP3 to the input under test. START set op7 0 set op8 0 set op6 0 set op1 1 set op2 0 set var1 0 ad1: inc var1 tstgt aip1 209 op6 set var1 0 tstlt aip1 200 op8 set var1 0 and var1 1 op7 tstlt var1 250 goto ad1 set op1 0 set op2 1 set var1 0 ad2: inc var1 tstgt aip2 209 op6 set var1 0 tstlt aip2 200 op8 set var1 0 and var1 1 op7 tstlt var1 250 goto ad2 set op1 1 set op2 1 set var1 0 ad3: inc var1 tstgt aip3 209 op6 set var1 0 tstlt aip3 200 op8 set var1 0 and var1 1 op7 tstlt var1 250 goto ad3 set op1 0 set op2 0 set op7 0 set op3 0 set var3 1 i1l: set var2 ip1 callsub show tstne ip1 0 goto i1l set op3 1 i1h: set var2 ip1 callsub show tstne ip1 1 goto i1h callsub green set var3 2 set op3 0 i2l: set var2 ip2 callsub show tstne ip2 0 goto i2l set op3 1 i2h: set var2 ip2 callsub show tstne ip2 1 goto i2h callsub green set var3 3 set op3 0 i3l: set var2 ip3 callsub show tstne ip3 0 goto i3l set op3 1 i3h: set var2 ip3 callsub show tstne ip3 1 goto i3h callsub green set var3 4 set op3 0 i4l: set var2 ip4 callsub show tstne ip4 0 goto i4l set op3 1 i4h: set var2 ip4 callsub show tstne ip4 1 goto i4h callsub green set var3 5 set op3 0 i5l: set var2 ip5 callsub show tstne ip5 0 goto i5l set op3 1 i5h: set var2 ip5 callsub show tstne ip5 1 goto i5h callsub green set var3 6 set op3 0 i6l: set var2 ip6 callsub show tstne ip6 0 goto i6l set op3 1 i6h: set var2 ip6 callsub show tstne ip6 1 goto i6h callsub green set var3 7 set op3 0 i7l: set var2 ip7 callsub show tstne ip7 0 goto i7l set op3 1 i7h: set var2 ip7 callsub show tstne ip7 1 goto i7h callsub green set var3 8 set op3 0 i8l: set var2 ip8 callsub show tstne ip8 0 goto i8l set op3 1 i8h: set var2 ip8 callsub show tstne ip8 1 goto i8h end show: tsteq var2 0 op8 nop tsteq var2 1 op6 nop set ram1 var3 blink: set op1 1 delay 50 set op1 0 delay 50 dec ram1 bnz blink delay 250 ret green: set op8 0 set op7 1 set op6 0 delay 500 set op7 0 ret