Make your own free website on Tripod.com

68HC11 Example Code for an Erbium Doped FIber Amplifier

              
                *6811*
*6811*
0000 ORG $0000 *ANTEC/ELECTRONIC SYSTEM PRODUCTS *
0000 AD0 RMB 1 *ERBIUM-DOPED FIBER AMPLIFIER CODE
0001 AD1 RMB 1 *REVISION 6-16-97
0002 AD2 RMB 1 *AD REGISTERS HOLD THE A/D VALUES
0003 AD3 RMB 1
0004 AD4 RMB 1
0005 AD5 RMB 1
0006 AD6 RMB 1
0007 AD7 RMB 1
0008 MENUNO RMB 1
0009 PUMPLNO RMB 1
000A TEMP1 RMB 1
000B TEMP2 RMB 1
000C TEMP3 RMB 1
000D TEMP4 RMB 1
000E L1AD2 RMB 1
000F L1AD3 RMB 1
0010 L1AD4 RMB 1
0011 BCDTEMP RMB 2
0013 LDPL RMB 1 *WORKING LASER BOARD DIGIPOT LASER CONTROL
0014 LDPT RMB 1 *WORKING LASER BOARD DIGIPOT THERMAL CONTROL
0015 LCONTROL RMB 1 *WORKING LASER BOARD MASTER CONTROL
0016 L1DPL RMB 1 *LASER 1 BOARD DIGIPOT LASER CONTROL
0017 L1DPT RMB 1 *LASER 1 BOARD DIGIPOT THERMAL CONTROL
0018 L1CONTROL RMB 1 *LASER 1 BOARD MASTER CONTROL
0019 L2DPL RMB 1 *LASER 2 BOARD DIGIPOT LASER CONTROL
001A L2DPT RMB 1 *LASER 2 BOARD DIGIPOT THERMAL CONTROL
001B L2CONTROL RMB 1 *LASER 2 BOARD MASTER CONTROL
001C L3DPL RMB 1 *LASER 3 BOARD DIGIPOT LASER CONTROL
001D L3DPT RMB 1 *LASER 3 BOARD DIGIPOT THERMAL CONTROL
001E L3CONTROL RMB 1 *LASER 3 BOARD MASTER CONTROL
001F L4DPL RMB 1 *LASER 4 BOARD DIGIPOT LASER CONTROL
0020 L4DPT RMB 1 *LASER 4 BOARD DIGIPOT THERMAL CONTROL
0021 L4CONTROL RMB 1 *LASER 4 BOARD MASTER CONTROL
C000 ORG $C000 *ORIGIN*
C000 53 65 6C 65 63 74 MSG1 FCC 'Select Laser 1/2/3/4=? '
20 4C 61 73 65 72
20 31 2F 32 2F 33
2F 34 3D 3F 20 20
C018 04 FCB $04 End-of-message mark
C019 53 74 61 74 75 73 MSG2 FCC 'Status = Normal '
20 3D 20 4E 6F 72
6D 61 6C 20 20 20
20 20 20 20 20 20
C031 04 FCB $04 End-of-message mark
C032 50 75 6D 70 20 4C MSG3 FCC 'Pump Laser ?: I='
61 73 65 72 20 3F
3A 20 20 20 49 3D
C044 L2AD3 RMB 1
C045 L3AD3 RMB 1
C046 L4AD3 RMB 1
C047 20 6D 61 MSG3A FCC ' ma'
C04A 04 FCB $04 End-of-message mark
C04B 50 6F 77 65 72 3D MSG4 FCC 'Power=0 dBm: EDFA=0 dBm'
30 20 64 42 6D 3A
20 20 45 44 46 41
3D 30 20 64 42 6D
C063 04 FCB $04 End-of-message mark
C064 54 65 6D 70 2E 20 MSG5 FCC 'Temp. set point ? = 25 C'
73 65 74 20 70 6F
69 6E 74 20 3F 20
3D 20 32 35 20 43
C07C 04 FCB $04 End-of-message mark
C07D 54 68 65 72 6D 69 MSG6 FCC 'Thermistor Res.=10K ohms'
73 74 6F 72 20 52
65 73 2E 3D 31 30
4B 20 6F 68 6D 73
C095 04 FCB $04 End-of-message mark
C096 43 6F 6F 6C 65 72 MSG7 FCC 'Cooler ? current='
20 3F 20 63 75 72
72 65 6E 74 3D
C0A7 L2AD4 RMB 1
C0A8 L3AD4 RMB 1
C0A9 L4AD4 RMB 1
C0AA 20 6D 61 20 MSG7A FCC ' ma '
C0AE 04 FCB $04 End-of-message mark
C0AF 4C 61 73 65 72 20 MSG8 FCC 'Laser ? PDcurrent='
3F 20 50 44 63 75
72 72 65 6E 74 3D
C0C1 L2AD2 RMB 1
C0C2 2E FCB '.'
C0C3 L3AD2 RMB 1
C0C4 L4AD2 RMB 1
C0C5 6D 61 FCC 'ma'
C0C7 04 FCB $04 End-of-message mark
C0C8 45 44 46 41 20 69 MSG9 FCC 'EDFA in PD current=00ma '
6E 20 50 44 20 63
75 72 72 65 6E 74
3D 30 30 6D 61 20
C0E0 04 FCB $04 End-of-message mark
C0E1 45 44 46 41 20 6F MSG10 FCC 'EDFA out PD current=00ma'
75 74 20 50 44 20
63 75 72 72 65 6E
74 3D 30 30 6D 61
C0F9 04 FCB $04 End-of-message mark
C0FA 45 44 46 41 20 69 MSG11 FCC 'EDFA in PD power=00 dBm '
6E 20 50 44 20 70
6F 77 65 72 3D 30
30 20 64 42 6D 20
C112 04 FCB $04 End-of-message mark
C113 45 44 46 41 20 6F MSG12 FCC 'EDFA out PD power=00 dBm'
75 74 20 50 44 20
70 6F 77 65 72 3D
30 30 20 64 42 6D
C12B 04 FCB $04 End-of-message mark
C12C 50 75 6D 70 20 4C MSG13 FCC 'Pump Laser ? On/Off ='
61 73 65 72 20 3F
20 4F 6E 2F 4F 66
66 20 3D
C141 ONOFF1 RMB 1
C142 ONOFF2 RMB 1
C143 ONOFF3 RMB 1
C144 04 FCB $04 End-of-message mark
C145 20 20 20 20 20 20 MSG14 FCC ' '
20 20 20 20 20 20
20 20 20 20 20 20
20 20 20 20 20 20
C15D 04 FCB $04 End-of-message mark
C15E 4E 6F 20 69 6E 70 MSG15 FCC 'No input: '
75 74 3A 20 20 20
20 20 20 20 20 20
20 20 20 20 20 20
C176 04 FCB $04 End-of-message mark
C177 4C 61 73 65 72 20 MSG16 FCC 'Laser ? ON/OFF = ON '
3F 20 4F 4E 2F 4F
46 46 20 3D 20 4F
4E 20 20 20 20 20
C18F 04 FCB $04 End-of-message mark
C190 45 44 47 41 20 49 MSG17 FCC 'EDGA Input Trigger Level'
6E 70 75 74 20 54
72 69 67 67 65 72
20 4C 65 76 65 6C
C1A8 04 FCB $04 End-of-message mark
C1A9 54 75 72 6E 20 45 MSG18 FCC 'Turn EDFA on at -20 dBm.'
44 46 41 20 6F 6E
20 61 74 20 2D 32
30 20 64 42 6D 2E
C1C1 04 FCB $04 End-of-message mark
C1C2 54 65 6D 70 2E 20 MSG19 FCC 'Temp. High = Laser ? OFF'
48 69 67 68 20 3D
20 4C 61 73 65 72
20 3F 20 4F 46 46
C1DA 04 FCB $04 End-of-message mark
C1DB 20 20 20 20 20 20 MSG20 FCC ' '
20 20 20 20 20 20
20 20 20 20 20 20
20 20 20 20 20 20
C1F3 04 FCB $04 End-of-message mark
C1F4 48 69 67 68 20 54 MSG21 FCC 'High Temp turn off level'
65 6D 70 20 74 75
72 6E 20 6F 66 66
20 6C 65 76 65 6C
C20C 04 FCB $04 End-of-message mark
C20D 4C 61 73 65 72 20 MSG22 FCC 'Laser ?, 35C Term.=8.2K '
3F 2C 20 33 35 43
20 54 65 72 6D 2E
3D 38 2E 32 4B 20
C225 04 FCB $04 End-of-message mark
C226 4C 6F 77 20 54 65 MSG23 FCC 'Low Temp turn off level'
6D 70 20 20 74 75
72 6E 20 6F 66 66
20 6C 65 76 65 6C
C23E 04 FCB $04 End-of-message mark
C23F 4C 61 73 65 72 20 MSG24 FCC 'Laser ?, 15C Term.=12.0K'
3F 2C 20 31 35 43
20 54 65 72 6D 2E
3D 31 32 2E 30 4B
C257 04 FCB $04 End-of-message mark
C258 53 61 76 65 20 73 MSG25 FCC 'Save settings Laser ? in'
65 74 74 69 6E 67
73 20 4C 61 73 65
72 20 3F 20 69 6E
C270 04 FCB $04 End-of-message mark
C271 45 45 50 52 4F 4D MSG26 FCC 'EEPROM: Save/Do not Save'
3A 20 53 61 76 65
2F 44 6F 20 6E 6F
74 20 53 61 76 65
C289 04 FCB $04 End-of-message mark
C28A 52 65 73 74 6F 72 MSG27 FCC 'Restore defaults laser ?'
65 20 64 65 66 61
75 6C 74 73 20 6C
61 73 65 72 20 3F
C2A2 04 FCB $04 End-of-message mark
C2A3 52 65 73 74 6F 72 MSG28 FCC 'Restore/Do not restore '
65 2F 44 6F 20 6E
6F 74 20 72 65 73
74 6F 72 65 20 20
C2BB 04 FCB $04 End-of-message mark
C2BC 4D 6F 64 65 6C 20 MSG29 FCC 'Model Number = Antec 000'
4E 75 6D 62 65 72
20 3D 20 41 6E 74
65 63 20 30 30 30
C2D4 04 FCB $04 End-of-message mark
C2D5 53 6F 66 74 77 61 MSG30 FCC 'Software Revision = 1.0 '
72 65 20 52 65 76
69 73 69 6F 6E 20
3D 20 31 2E 30 20
C2ED 04 FCB $04 End-of-message mark
C2EE 4D 75 6C 74 69 64 MSG31 FCC 'Multidrop RS485 addr = 1'
72 6F 70 20 52 53
34 38 35 20 61 64
64 72 20 3D 20 31
C306 04 FCB $04 End-of-message mark
C307 53 65 74 20 61 64 MSG32 FCC 'Set address to 1 '
64 72 65 73 73 20
74 6F 20 31 20 20
20 20 20 20 20 20
C31F 04 FCB $04 End-of-message mark
00E2 ORG $00E2 *SET INTERRUPT VECTOR LOCATIONS FOR EVB
00E2 7E C6 8C JMP SEL *INPUT CAPTURE 3 INTERRUPT SERVICE ROUTINE LOCATION
00E5 7E C7 17 JMP UP *INPUT CAPTURE 2 INTERRUPT SERVICE ROUTINE LOCATION
00E8 7E C7 51 JMP DOWN *INPUT CAPTURE 1 INTERRUPT SERVICE ROUTINE LOCATION
C400 ORG $C400
C400 86 00 LDAA #$00
C402 B7 10 24 STAA $1024 *DIVIDE E CLOCK BY 1*
C405 8E 00 40 LDS #$0040 *STACK
C408 86 53 LDAA #$53
C40A B7 10 28 STAA $1028 *INITIALIZE SPI
C40D 18 CE 10 00 LDY #$1000 *POINTER TO REGISTERS
C411 86 15 LDAA #$15 *CAPTURE ON RISING EDGE FOR INPUT CAPTURES 3,2, & 1
C413 B7 10 21 STAA $1021 *CAPTURE ON RISING EDGE ONLY
C416 86 07 LDAA #$07
C418 B7 10 23 STAA $1023 *ENABLE INPUT COMPARE 3,2,& 1 INTERRUPTS
C41B B7 10 22 STAA $1022 *ENABLE INPUT COMPARE 3, 2, & 1 INTERRUPTS
C41E 18 1C 07 FF BSET 7,Y $FF *SET ALL PORTS ON PORT C AS OUTPUTS
C422 18 1C 09 18 BSET 9,Y $18 *SET DATA DIRECTION PORT D3-D4 (SPI) AS OUTPUT
C426 18 1D 09 21 BCLR 9,Y $21 *SET SS PIN AS AN INPUT
C42A 18 1D 03 01 BCLR 3,Y $01 *TURN OFF (LOWER) CS LINE TO LASER 1 DIGIPOT
C42E 18 1C 03 02 BSET 3,Y $02 *DISABLE (RAISE) CS LINE TO LASER 1 CONTROL
C432 18 1D 03 04 BCLR 3,Y $04 *TURN OFF (LOWER) CS LINE TO LASER 2 DIGIPOT
C436 18 1C 03 08 BSET 3,Y $08 *DISABLE (RAISE) CS LINE TO LASER 2 CONTROL
C43A 18 1D 03 10 BCLR 3,Y $10 *TURN OFF (LOWER) CS LINE TO LASER 3 DIGIPOT
C43E 18 1C 03 20 BSET 3,Y $20 *DISABLE (RAISE) CS LINE TO LASER 3 CONTROL
C442 18 1D 03 40 BCLR 3,Y $40 *TURN OFF (LOWER) CS LINE TO LASER 4 DIGIPOT
C446 18 1C 03 80 BSET 3,Y $80 *DISABLE (RAISE) CS LINE TO LASER 4 CONTROL
C44A 86 00 LDAA #$00
C44C B7 10 02 STAA $1002 *USE STROBE B WHEN WRITING TO PORT B
C44F 97 08 STAA MENUNO
C451 97 15 STAA LCONTROL
C453 97 18 STAA L1CONTROL
C455 97 1B STAA L2CONTROL
C457 97 1E STAA L3CONTROL
C459 97 21 STAA L4CONTROL
C45B 86 31 LDAA #$31
C45D 97 09 STAA PUMPLNO *INITIALIZE PUMP LASER NUMBER TO 1
C45F BD C6 F3 JSR INITLCD
C462 BD C6 A6 JSR LCD
C465 86 80 LDAA #$80
C467 97 14 STAA LDPT
C469 97 13 STAA LDPL
C46B 97 17 STAA L1DPT
C46D 97 16 STAA L1DPL
C46F 97 1A STAA L2DPT
C471 97 19 STAA L2DPL
C473 97 1D STAA L3DPT
C475 97 1C STAA L3DPL
C477 97 20 STAA L4DPT
C479 97 1F STAA L4DPL
C47B 86 20 LDAA #$20
C47D B7 C1 41 STAA ONOFF1 *WRITE " ON" FOR DISPLAY MESSAGE THAT LASER IS ON
C480 86 4F LDAA #$4F *THESE THREE LOCATIONS WILL BE OVERWRITTEN LATER
C482 B7 C1 42 STAA ONOFF2 *WITH THE WORD "OFF" WHEN THE LASER IS TOGGLED
C485 86 4E LDAA #$4E *FROM ON TO OFF
C487 B7 C1 43 STAA ONOFF3
C48A 0E CLI *ENABLE INTERRUPTS
C48B 01 BEGIN: NOP
C48C 01 END2: NOP *JSR FLASHLED
C48D 86 00 LDAA #$00
C48F B7 10 22 STAA $1022 *DISABLE ENABLE INPUT COMPARE 3, 2, & 1 INTERRUPTS
C492 BD C5 C9 JSR CONTROL
C495 96 09 LDAA PUMPLNO
C497 81 31 CMPA #$31
C499 27 0C BEQ BSET01
C49B 81 32 CMPA #$32
C49D 27 0E BEQ BSET02
C49F 81 33 CMPA #$33
C4A1 27 10 BEQ BSET03
C4A3 81 34 CMPA #$34
C4A5 27 12 BEQ BSET04
C4A7 18 1C 03 01 BSET01: BSET 3,Y $01 *ENABLE (RAISE) CS LINE TO LASER DIGIPOT
C4AB 20 12 BRA NEXT1
C4AD 18 1C 03 04 BSET02: BSET 3,Y $04 *ENABLE (RAISE) CS LINE TO LASER DIGIPOT
C4B1 20 0C BRA NEXT1
C4B3 18 1C 03 10 BSET03: BSET 3,Y $10 *ENABLE (RAISE) CS LINE TO LASER DIGIPOT
C4B7 20 06 BRA NEXT1
C4B9 18 1C 03 40 BSET04: BSET 3,Y $40 *ENABLE (RAISE) CS LINE TO LASER DIGIPOT
C4BD 20 00 BRA NEXT1
C4BF B6 10 29 NEXT1: LDAA $1029 *CLEAR SPI INTERRUPT BIT
C4C2 86 00 LDAA #$00 *SET DIGIPOT STACK REGISTER TO 0
C4C4 B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C4C7 B6 10 29 SPI2: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C4CA 84 80 ANDA #$80 *CHECK SPI FLAG
C4CC 27 F9 BEQ SPI2 *LOOP TILL DONE
C4CE B6 10 29 LDAA $1029 *CLEAR SPI INTERRUPT BIT
C4D1 96 13 LDAA LDPL *SET DIGIPOT TO CONTROL LASER
C4D3 B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C4D6 B6 10 29 SPI3: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C4D9 84 80 ANDA #$80 *CHECK SPI FLAG
C4DB 27 F9 BEQ SPI3 *LOOP TILL DONE
C4DD B6 10 29 LDAA $1029 *CLEAR SPI INTERRUPT BIT
C4E0 96 14 LDAA LDPT *SET DIGIPOT TO CONTROL COOLER
C4E2 B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C4E5 B6 10 29 SPI4: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C4E8 84 80 ANDA #$80 *CHECK SPI FLAG
C4EA 27 F9 BEQ SPI4 *LOOP TILL DONE
C4EC 96 09 LDAA PUMPLNO
C4EE 81 31 CMPA #$31
C4F0 27 0C BEQ BCLR01
C4F2 81 32 CMPA #$32
C4F4 27 0E BEQ BCLR02
C4F6 81 33 CMPA #$33
C4F8 27 10 BEQ BCLR03
C4FA 81 34 CMPA #$34
C4FC 27 12 BEQ BCLR04
C4FE 18 1D 03 01 BCLR01: BCLR 3,Y $01 *DISABLE (LOWER) CS LINE TO LASER DIGIPOT
C502 20 12 BRA NEXT2
C504 18 1D 03 04 BCLR02: BCLR 3,Y $04 *DISABLE (LOWER) CS LINE TO LASER DIGIPOT
C508 20 0C BRA NEXT2
C50A 18 1D 03 10 BCLR03: BCLR 3,Y $10 *DISABLE (LOWER) CS LINE TO LASER DIGIPOT
C50E 20 06 BRA NEXT2
C510 18 1D 03 40 BCLR04: BCLR 3,Y $40 *DISABLE (LOWER) CS LINE TO LASER DIGIPOT
C514 20 00 BRA NEXT2
C516 86 07 NEXT2: LDAA #$07
C518 B7 10 22 STAA $1022 *ENABLE INPUT COMPARE 3, 2, & 1 INTERRUPTS
C51B BD C8 BD JSR AD *JUMP TO ANALOG-TO-DIGITAL SUBROUTINE
C51E 96 15 LDAA LCONTROL *THIS SECTION LOOKS AT THE LCONTROL 8-BIT WORD
C520 85 04 BITA #$04 *AND DETERMINES IF THE WORD "ON" OR "OFF" SHOULD
C522 27 11 BEQ TURN2 *BE WRITTEN TO THE LCD WHEN THE LCD IS ON MENU 6
C524 26 00 BNE TURN1
C526 86 4F TURN1: LDAA #$4F
C528 B7 C1 41 STAA ONOFF1
C52B 86 46 LDAA #$46
C52D B7 C1 42 STAA ONOFF2
C530 B7 C1 43 STAA ONOFF3
C533 20 0F BRA ENDTURN
C535 86 20 TURN2: LDAA #$20
C537 B7 C1 41 STAA ONOFF1
C53A 86 4F LDAA #$4F
C53C B7 C1 42 STAA ONOFF2
C53F 86 4E LDAA #$4E
C541 B7 C1 43 STAA ONOFF3
C544 01 ENDTURN: NOP
C545 5F CLRB *CLEAR ACCUMULATOR B
C546 D6 03 LDAB AD3 *LOAD ACCUMULATOR A WITH AD3
C548 86 96 LDAA #150 *THIS ROUTINE IS FOR THE PUMP LASER CURRENT
C54A 3D MUL
C54B CE 00 64 LDX #100
C54E 02 IDIV
C54F 8F XGDX
C550 BD C8 FE JSR BCD *CONVERT IT TO BCD
C553 96 0A LDAA TEMP1
C555 97 0F STAA L1AD3
C557 96 0B LDAA TEMP2
C559 B7 C0 44 STAA L2AD3
C55C 96 0C LDAA TEMP3
C55E B7 C0 45 STAA L3AD3
C561 96 0D LDAA TEMP4
C563 B7 C0 46 STAA L4AD3
C566 5F CLRB *CLEAR ACCUMULATOR B
C567 D6 04 LDAB AD4 *LOAD ACCUMULATOR A WITH AD4
C569 86 1A LDAA #26 *THIS ROUTINE IS FOR THE COOLER CURRENT
C56B 3D MUL
C56C CE 00 05 LDX #5
C56F 02 IDIV
C570 8F XGDX
C571 BD C8 FE JSR BCD *CONVERT IT TO BCD
C574 96 0A LDAA TEMP1
C576 97 10 STAA L1AD4
C578 96 0B LDAA TEMP2
C57A B7 C0 A7 STAA L2AD4
C57D 96 0C LDAA TEMP3
C57F B7 C0 A8 STAA L3AD4
C582 96 0D LDAA TEMP4
C584 B7 C0 A9 STAA L4AD4
C587 5F CLRB *CLEAR ACCUMULATOR B
C588 C6 FF LDAB #$FF
C58A D0 02 SUBB AD2
C58C 86 77 LDAA #119 *THIS ROUTINE IS FOR THE PHOTODIODE CURRENT
C58E 3D MUL
C58F CE 00 32 LDX #50
C592 02 IDIV
C593 8F XGDX
C594 BD C8 FE JSR BCD *CONVERT IT TO BCD
C597 96 0A LDAA TEMP1
C599 97 0E STAA L1AD2
C59B 96 0B LDAA TEMP2
C59D B7 C0 C1 STAA L2AD2
C5A0 96 0C LDAA TEMP3
C5A2 81 20 CMPA #$20 *A DECIMAL POINT APPEARS BEFORE TEMP3, SO WE DON'T
C5A4 26 02 BNE RLP1 *WANT TO BLANK A LEADING ZERO AFTER THE DECIMAL POINT
C5A6 86 30 LDAA #$30 *THEREFORE WE LOOK FOR BLANKS (#$20) AND REPLACE THEM 
C5A8 B7 C0 C3 RLP1: STAA L3AD2 *WITH ZEROES (#$30)
C5AB 96 0D LDAA TEMP4
C5AD 81 20 CMPA #$20
C5AF 26 02 BNE RLP2
C5B1 86 30 LDAA #$30
C5B3 B7 C0 C4 RLP2: STAA L4AD2
C5B6 86 00 LDAA #$00
C5B8 B7 10 22 STAA $1022 *DISABLE ENABLE INPUT COMPARE 3, 2, & 1 INTERRUPTS
C5BB BD C6 F3 JSR INITLCD
C5BE BD C6 A6 JSR LCD
C5C1 86 07 LDAA #$07
C5C3 B7 10 22 STAA $1022 *ENABLE INPUT COMPARE 3, 2, & 1 INTERRUPTS
C5C6 7E C4 8C JMP END2
C5C9 01 CONTROL: NOP
C5CA 18 1D 03 02 BCLR 3,Y $02 *ENABLE (LOWER) CS LINE TO LASER CONTROL
C5CE B6 10 29 LDAA $1029 *CLEAR SPI INTERRUPT BIT
C5D1 86 01 LDAA #$01 *TURN OFF LED, TURN OFF ANALOG SWITCHES
C5D3 B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C5D6 B6 10 29 SPI81: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C5D9 84 80 ANDA #$80 *CHECK SPI FLAG
C5DB 27 F9 BEQ SPI81 *LOOP TILL DONE
C5DD 18 1C 03 02 BSET 3,Y $02 *DISABLE (RAISE) CS LINE TO LASER CONTROL
C5E1 18 1D 03 08 BCLR 3,Y $08 *ENABLE (LOWER) CS LINE TO LASER CONTROL
C5E5 B6 10 29 LDAA $1029 *CLEAR SPI INTERRUPT BIT
C5E8 86 01 LDAA #$01 *TURN OFF LED, TURN OFF ANALOG SWITCHES
C5EA B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C5ED B6 10 29 SPI82: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C5F0 84 80 ANDA #$80 *CHECK SPI FLAG
C5F2 27 F9 BEQ SPI82 *LOOP TILL DONE
C5F4 18 1C 03 08 BSET 3,Y $08 *DISABLE (RAISE) CS LINE TO LASER CONTROL
C5F8 18 1D 03 20 BCLR 3,Y $20 *ENABLE (LOWER) CS LINE TO LASER CONTROL
C5FC B6 10 29 LDAA $1029 *CLEAR SPI INTERRUPT BIT
C5FF 86 01 LDAA #$01 *TURN OFF LED, TURN OFF ANALOG SWITCHES
C601 B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C604 B6 10 29 SPI83: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C607 84 80 ANDA #$80 *CHECK SPI FLAG
C609 27 F9 BEQ SPI83 *LOOP TILL DONE
C60B 18 1C 03 20 BSET 3,Y $20 *DISABLE (RAISE) CS LINE TO LASER CONTROL
C60F 18 1D 03 80 BCLR 3,Y $80 *ENABLE (LOWER) CS LINE TO LASER CONTROL
C613 B6 10 29 LDAA $1029 *CLEAR SPI INTERRUPT BIT
C616 86 01 LDAA #$01 *TURN OFF LED, TURN OFF ANALOG SWITCHES
C618 B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C61B B6 10 29 SPI84: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C61E 84 80 ANDA #$80 *CHECK SPI FLAG
C620 27 F9 BEQ SPI84 *LOOP TILL DONE
C622 18 1C 03 80 BSET 3,Y $80 *DISABLE (RAISE) CS LINE TO LASER CONTROL
C626 96 09 LDAA PUMPLNO
C628 81 31 CMPA #$31
C62A 27 0C BEQ BCLR1
C62C 81 32 CMPA #$32
C62E 27 0E BEQ BCLR2
C630 81 33 CMPA #$33
C632 27 10 BEQ BCLR3
C634 81 34 CMPA #$34
C636 27 12 BEQ BCLR4
C638 18 1D 03 02 BCLR1: BCLR 3,Y $02 *ENABLE (LOWER) CS LINE TO LASER CONTROL
C63C 20 12 BRA NEXT3
C63E 18 1D 03 08 BCLR2: BCLR 3,Y $08 *ENABLE (LOWER) CS LINE TO LASER CONTROL
C642 20 0C BRA NEXT3
C644 18 1D 03 20 BCLR3: BCLR 3,Y $20 *ENABLE (LOWER) CS LINE TO LASER CONTROL
C648 20 06 BRA NEXT3
C64A 18 1D 03 80 BCLR4: BCLR 3,Y $80 *ENABLE (LOWER) CS LINE TO LASER CONTROL
C64E 20 00 BRA NEXT3
C650 B6 10 29 NEXT3: LDAA $1029 *CLEAR SPI INTERRUPT BIT
C653 96 15 LDAA LCONTROL
C655 8A 08 ORA #$08 *TURN ON LED
C657 B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C65A B6 10 29 SPI8: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C65D 84 80 ANDA #$80 *CHECK SPI FLAG
C65F 27 F9 BEQ SPI8 *LOOP TILL DONE
C661 96 09 LDAA PUMPLNO
C663 81 31 CMPA #$31
C665 27 0C BEQ BSET1
C667 81 32 CMPA #$32
C669 27 0E BEQ BSET2
C66B 81 33 CMPA #$33
C66D 27 10 BEQ BSET3
C66F 81 34 CMPA #$34
C671 27 12 BEQ BSET4
C673 18 1C 03 02 BSET1: BSET 3,Y $02 *DISABLE (RAISE) CS LINE TO LASER CONTROL
C677 20 12 BRA NEXT4
C679 18 1C 03 08 BSET2: BSET 3,Y $08 *DISABLE (RAISE) CS LINE TO LASER CONTROL
C67D 20 0C BRA NEXT4
C67F 18 1C 03 20 BSET3: BSET 3,Y $20 *DISABLE (RAISE) CS LINE TO LASER CONTROL
C683 20 06 BRA NEXT4
C685 18 1C 03 80 BSET4: BSET 3,Y $80 *DISABLE (RAISE) CS LINE TO LASER CONTROL
C689 20 00 BRA NEXT4
C68B 39 NEXT4: RTS
C68C 0F SEL: SEI
C68D 01 NOP *JSR INITLCD
C68E 01 NOP *JSR LCD
C68F 7C 00 08 INC MENUNO *INCREMENT MENUNO FOR NEXT MESSAGE IN
C692 96 08 LDAA MENUNO *THE SEQUENCE
C694 81 10 CMPA #$10 *IF MENUNO = 16 THEN BUMP IT BACK TO 0
C696 26 04 BNE ENDL2
C698 86 00 LDAA #$00
C69A 97 08 STAA MENUNO
C69C BD C8 A1 ENDL2: JSR DELAY1
C69F 86 01 LDAA #$01
C6A1 B7 10 23 STAA $1023 *CLEAR INTERRUPT FLAG
C6A4 0E CLI
C6A5 3B RTI
C6A6 96 08 LCD: LDAA MENUNO *DETERMINE WHICH MESSAGE TO DISPLAY
C6A8 C6 32 LDAB #$32 *HEX FOR 50
C6AA 3D MUL
C6AB C3 C0 00 ADDD #$C000
C6AE 8F XGDX *EXCHANGE DOUBLE ACCUMULATOR AND REGISTER X
C6AF A6 00 LCDA: LDAA 0,X *DISPLAY THE MESSAGE CHOSEN BY MENUNO
C6B1 81 04 CMPA #$04
C6B3 27 10 BEQ ENDLCD
C6B5 81 3F CMPA #$3F
C6B7 26 02 BNE NOQ *CHARACTER IS NOT A QUESTION MARK
C6B9 96 09 LDAA PUMPLNO *REPLACE QUESTION WITH PUMP LASER NUMBER
C6BB B7 10 04 NOQ: STAA $1004
C6BE BD C8 93 JSR DELAY
C6C1 08 INX
C6C2 7E C6 AF JMP LCDA
C6C5 18 1D 00 08 ENDLCD: BCLR 0,Y #$08 *SET LCD FOR INSTRUCTION ENTRY
C6C9 BD C8 93 JSR DELAY
C6CC 86 A8 LDAA #$A8 *SWITCH TO SECOND LINE OF LCD
C6CE B7 10 04 STAA $1004
C6D1 BD C8 93 JSR DELAY
C6D4 18 1C 00 08 BSET 0,Y #$08 *SET LCD FOR CHARACTER COMING
C6D8 BD C8 93 JSR DELAY
C6DB 08 INX
C6DC A6 00 LCDB: LDAA 0,X
C6DE 81 04 CMPA #$04
C6E0 27 10 BEQ ENDL3
C6E2 81 3F CMPA #$3F *CHECK FOR QUESTION MARK
C6E4 26 02 BNE NOQ1
C6E6 96 09 LDAA PUMPLNO *REPLACE QUESTION MARK WITH PUMP LASER NUMBER
C6E8 B7 10 04 NOQ1: STAA $1004
C6EB BD C8 93 JSR DELAY
C6EE 08 INX
C6EF 7E C6 DC JMP LCDB
C6F2 39 ENDL3: RTS
C6F3 18 1D 00 08 INITLCD: BCLR 0,Y #$08 *SET PORT C FOR INSTRUCTION ENTRY TO LCD
C6F7 86 3F LDAA #$3F *ENABLE FUNCTION SET
C6F9 B7 10 04 STAA $1004 *WRITE TO PORT B WITH STROBE
C6FC BD C8 93 JSR DELAY
C6FF 01 NOP *LDAA #$01 *CLEAR DISPLAY
C700 01 NOP *STAA $1004 *WRITE TO PORT B WITH STROBE
C701 01 NOP *JSR DELAY
C702 86 03 LDAA #$03 *CURSOR AT HOME
C704 B7 10 04 STAA $1004 *WRITE TO PORT B WITH STROBE
C707 BD C8 93 JSR DELAY
C70A 86 0F LDAA #$0F *CURSOR CONTROL
C70C B7 10 04 STAA $1004 *WRITE TO PORT B WITH STROBE 
C70F BD C8 93 JSR DELAY
C712 18 1C 00 08 BSET 0,Y #$08 *WRITE TO PORT C TO TELL LCD A CHAR IS COMING
C716 39 RTS
C717 0F UP: SEI
C718 96 08 LDAA MENUNO
C71A 81 00 CMPA #$00
C71C 27 0A BEQ MENU0UP
C71E 81 01 CMPA #$01
C720 27 18 BEQ MENU1UP
C722 81 06 CMPA #$06
C724 27 19 BEQ MENU6UP
C726 20 1F BRA UP1
C728 BD C7 8B MENU0UP: JSR PUSHFWD
C72B 7C 00 09 INC PUMPLNO
C72E 96 09 LDAA PUMPLNO
C730 81 35 CMPA #$35 *IF PUMP LASER NUMBER IS 5, MAKE IT 1
C732 26 13 BNE UP1
C734 86 31 LDAA #$31
C736 97 09 STAA PUMPLNO
C738 20 0D BRA UP1
C73A 7C 00 13 MENU1UP: INC LDPL
C73D 20 08 BRA UP1
C73F 96 15 MENU6UP: LDAA LCONTROL
C741 88 04 EORA #$04
C743 97 15 STAA LCONTROL
C745 20 00 BRA UP1
C747 BD C8 A1 UP1: JSR DELAY1 *DEBOUNCE TIME DELAY
C74A 86 02 LDAA #$02
C74C B7 10 23 STAA $1023 *CLEAR INTERRUPT FLAG
C74F 0E CLI
C750 3B RTI
C751 0F DOWN: SEI
C752 96 08 LDAA MENUNO
C754 81 00 CMPA #$00
C756 27 0A BEQ MENU0DW
C758 81 01 CMPA #$01
C75A 27 18 BEQ MENU1DW
C75C 81 06 CMPA #$06
C75E 27 19 BEQ MENU6DW
C760 20 1F BRA DOWN1
C762 BD C8 0F MENU0DW: JSR PUSHBW
C765 7A 00 09 DEC PUMPLNO
C768 96 09 LDAA PUMPLNO
C76A 81 30 CMPA #$30 *IF PUMP LASER NUMBER IS 0, MAKE IT 4
C76C 26 13 BNE DOWN1
C76E 86 34 LDAA #$34
C770 97 09 STAA PUMPLNO
C772 20 0D BRA DOWN1
C774 7A 00 13 MENU1DW: DEC LDPL
C777 20 08 BRA DOWN1
C779 96 15 MENU6DW: LDAA LCONTROL
C77B 88 04 EORA #$04
C77D 97 15 STAA LCONTROL
C77F 20 00 BRA DOWN1
C781 BD C8 A1 DOWN1: JSR DELAY1 *DEBOUNCE TIME DELAY
C784 86 04 LDAA #$04
C786 B7 10 23 STAA $1023 *CLEAR INTERRUPT FLAG
C789 0E CLI 
C78A 3B RTI
C78B 96 15 PUSHFWD: LDAA LCONTROL
C78D 97 0A STAA TEMP1 *SAVE LCONTROL FOR TEMPORARY USE
C78F 84 F7 ANDA #$F7 *SET BIT TO TURN OFF LED
C791 8A 01 ORA #$01 *SET BIT TO TURN OFF ANALOG SWITCHES
C793 96 15 LDAA LCONTROL *GET READY TO SPI LCONTROL WITH NEW DATA
C795 BD C5 C9 JSR CONTROL
C798 96 0A LDAA TEMP1
C79A 97 15 STAA LCONTROL
C79C D6 09 LDAB PUMPLNO
C79E C1 31 CMPB #$31
C7A0 26 18 BNE UPDATE1
C7A2 96 14 LDAA LDPT
C7A4 97 17 STAA L1DPT
C7A6 96 13 LDAA LDPL
C7A8 97 16 STAA L1DPL
C7AA 96 15 LDAA LCONTROL
C7AC 97 18 STAA L1CONTROL
C7AE 96 1B LDAA L2CONTROL
C7B0 97 15 STAA LCONTROL
C7B2 96 1A LDAA L2DPT
C7B4 97 14 STAA LDPT
C7B6 96 19 LDAA L2DPL
C7B8 97 13 STAA LDPL
C7BA C1 32 UPDATE1: CMPB #$32
C7BC 26 18 BNE UPDATE2
C7BE 96 14 LDAA LDPT
C7C0 97 1A STAA L2DPT
C7C2 96 13 LDAA LDPL
C7C4 97 19 STAA L2DPL
C7C6 96 15 LDAA LCONTROL
C7C8 97 1B STAA L2CONTROL
C7CA 96 1E LDAA L3CONTROL
C7CC 97 15 STAA LCONTROL
C7CE 96 1D LDAA L3DPT
C7D0 97 14 STAA LDPT
C7D2 96 1C LDAA L3DPL
C7D4 97 13 STAA LDPL
C7D6 C1 33 UPDATE2: CMPB #$33
C7D8 26 18 BNE UPDATE3
C7DA 96 14 LDAA LDPT
C7DC 97 1D STAA L3DPT
C7DE 96 13 LDAA LDPL
C7E0 97 1C STAA L3DPL
C7E2 96 15 LDAA LCONTROL
C7E4 97 1E STAA L3CONTROL
C7E6 96 21 LDAA L4CONTROL
C7E8 97 15 STAA LCONTROL
C7EA 96 20 LDAA L4DPT
C7EC 97 14 STAA LDPT
C7EE 96 1F LDAA L4DPL
C7F0 97 13 STAA LDPL
C7F2 C1 34 UPDATE3: CMPB #$34
C7F4 26 18 BNE UPDATE4
C7F6 96 14 LDAA LDPT
C7F8 97 20 STAA L4DPT
C7FA 96 13 LDAA LDPL
C7FC 97 1F STAA L4DPL
C7FE 96 15 LDAA LCONTROL
C800 97 21 STAA L4CONTROL
C802 96 18 LDAA L1CONTROL
C804 97 15 STAA LCONTROL
C806 96 17 LDAA L1DPT
C808 97 14 STAA LDPT
C80A 96 16 LDAA L1DPL
C80C 97 13 STAA LDPL
C80E 39 UPDATE4: RTS
C80F 96 15 PUSHBW: LDAA LCONTROL
C811 97 0A STAA TEMP1 *SAVE LCONTROL FOR TEMPORARY USE
C813 84 F7 ANDA #$F7 *SET BIT TO TURN OFF LED
C815 8A 01 ORA #$01 *SET BIT TO TURN OFF ANALOG SWITCHES
C817 96 15 LDAA LCONTROL *GET READY TO SPI LCONTROL WITH NEW DATA
C819 BD C5 C9 JSR CONTROL
C81C 96 0A LDAA TEMP1
C81E 97 15 STAA LCONTROL
C820 D6 09 LDAB PUMPLNO
C822 C1 31 CMPB #$31
C824 26 18 BNE DWDATE1
C826 96 14 LDAA LDPT
C828 97 17 STAA L1DPT
C82A 96 13 LDAA LDPL
C82C 97 16 STAA L1DPL
C82E 96 15 LDAA LCONTROL
C830 97 18 STAA L1CONTROL
C832 96 21 LDAA L4CONTROL
C834 97 15 STAA LCONTROL
C836 96 20 LDAA L4DPT
C838 97 14 STAA LDPT
C83A 96 1F LDAA L4DPL
C83C 97 13 STAA LDPL
C83E C1 32 DWDATE1: CMPB #$32
C840 26 18 BNE DWDATE2
C842 96 14 LDAA LDPT
C844 97 1A STAA L2DPT
C846 96 13 LDAA LDPL
C848 97 19 STAA L2DPL
C84A 96 15 LDAA LCONTROL
C84C 97 1B STAA L2CONTROL
C84E 96 18 LDAA L1CONTROL
C850 97 15 STAA LCONTROL
C852 96 17 LDAA L1DPT
C854 97 14 STAA LDPT
C856 96 16 LDAA L1DPL
C858 97 13 STAA LDPL
C85A C1 33 DWDATE2: CMPB #$33
C85C 26 18 BNE DWDATE3
C85E 96 14 LDAA LDPT
C860 97 1D STAA L3DPT
C862 96 13 LDAA LDPL
C864 97 1C STAA L3DPL
C866 96 15 LDAA LCONTROL
C868 97 1E STAA L3CONTROL
C86A 96 1B LDAA L2CONTROL
C86C 97 15 STAA LCONTROL
C86E 96 1A LDAA L2DPT
C870 97 14 STAA LDPT
C872 96 19 LDAA L2DPL
C874 97 13 STAA LDPL
C876 C1 34 DWDATE3: CMPB #$34
C878 26 18 BNE DWDATE4
C87A 96 14 LDAA LDPT
C87C 97 20 STAA L4DPT
C87E 96 13 LDAA LDPL
C880 97 1F STAA L4DPL
C882 96 15 LDAA LCONTROL
C884 97 21 STAA L4CONTROL
C886 96 1E LDAA L3CONTROL
C888 97 15 STAA LCONTROL
C88A 96 1D LDAA L3DPT
C88C 97 14 STAA LDPT
C88E 96 1C LDAA L3DPL
C890 97 13 STAA LDPL
C892 39 DWDATE4: RTS
C893 86 04 DELAY: LDAA #$04 *THIS SUBROUTINE WAITS TILL LCD IS READY FOR NEXT
C895 3C PSHX
C896 CE 00 40 WSEC2: LDX #$040
C899 09 WSEC1: DEX
C89A 26 FD BNE WSEC1
C89C 4A DECA
C89D 26 F7 BNE WSEC2
C89F 38 PULX
C8A0 39 RTS
C8A1 86 10 DELAY1: LDAA #$10 *THIS SUBROUTINE WAITS TILL LCD IS READY FOR NEXT
C8A3 3C PSHX
C8A4 CE 14 00 WSEC3: LDX #$1400
C8A7 09 WSEC4: DEX
C8A8 26 FD BNE WSEC4
C8AA 4A DECA
C8AB 26 F7 BNE WSEC3
C8AD 38 PULX
C8AE 39 RTS
C8AF 86 14 DELAY2: LDAA #$14 *THIS SUBROUTINE WAITS TILL LCD IS READY FOR NEXT
C8B1 3C PSHX
C8B2 CE 14 00 WSEC5: LDX #$1400
C8B5 09 WSEC6: DEX
C8B6 26 FD BNE WSEC6
C8B8 4A DECA
C8B9 26 F7 BNE WSEC5
C8BB 38 PULX
C8BC 39 RTS
C8BD 86 10 AD: LDAA #$10 *Set for Multiple Scan on A/D for A/D inputs 1-4
C8BF B7 10 30 STAA $1030 *Writing to $1030 also begins conversion
C8C2 B6 10 30 REP1: LDAA $1030 *Want to read CCF bit, highest bit
C8C5 84 80 ANDA #$80 *Look at CCF bit
C8C7 27 F9 BEQ REP1 *A/D 1-4 outputs will be in Registers 1031-1034
C8C9 B6 10 31 LDAA $1031
C8CC 97 00 STAA AD0
C8CE B6 10 32 LDAA $1032
C8D1 97 01 STAA AD1
C8D3 B6 10 33 LDAA $1033
C8D6 97 02 STAA AD2
C8D8 B6 10 34 LDAA $1034
C8DB 97 03 STAA AD3
C8DD 86 14 LDAA #$14 *Set for Multiple Scan on A/D for A/D inputs 5-8
C8DF B7 10 30 STAA $1030 *Writing to $1030 also begins conversion
C8E2 B6 10 30 REP2: LDAA $1030 *Want to read CCF bit, highest bit
C8E5 84 80 ANDA #$80 *Look at CCF bit
C8E7 27 F9 BEQ REP2 *A/D 5-8 outputs will be in Registers 1031-1034
C8E9 B6 10 31 LDAA $1031
C8EC 97 04 STAA AD4
C8EE B6 10 32 LDAA $1032
C8F1 97 05 STAA AD5
C8F3 B6 10 33 LDAA $1033
C8F6 97 06 STAA AD6
C8F8 B6 10 34 LDAA $1034
C8FB 97 07 STAA AD7
C8FD 39 RTS
C8FE CE 03 E8 BCD: LDX #1000 *GET DENUMERATOR 1000
C901 02 IDIV * DIVIDE D BY 1000 -----QUOTIENT X
C902 8F XGDX *NOW QUOTIENT IN D |_______REMINDER D
C903 97 0A STAA TEMP1 *LOWER BYTE IN TEMP1 THOUSANDS
C905 8F XGDX *QUOTIENT IN X REMINDER IN D AGAIN :
C906 CE 00 64 LDX #100 *GET DENUMERATOR 100
C909 02 IDIV * DIVIDE D BY 100 -----QUOTIENT X
C90A 8F XGDX *NOW QUOTIENT IN D |_______REMINDER D
C90B 97 0B STAA TEMP2 *LOWER BYTE IN TEMP2 HUNDREDS
C90D 8F XGDX *QUOTIENT IN X REMINDER IN D AGAIN :
C90E CE 00 0A LDX #10 *GET DENUMERATOR 10
C911 02 IDIV * DIVIDE D BY 10 -----QUOTIENT X
C912 97 0D STAA TEMP4 *LOWER BYTE IN TEMP4 UNITS |_______REMINDER D
C914 8F XGDX *NOW QUOTIENT IN D 
C915 97 0C STAA TEMP3 *LOWER BYTE IN TEMP3 TENS
C917 8F XGDX *QUOTIENT IN X REMINDER IN D AGAIN
C918 C6 00 LDAB #$00
C91A 86 00 LDAA #$00
779: Symbol Undefined on Pass 2
779: Warning --- Indexed Addressing Assumed
C91C A4 00 LOOPBCD ANDA B,TEMP1 *AND ACCUMMULATOR A & TEMP1+0=TEMP1
C91E 26 04 BNE SKPBLK *DO NOT PUT SPACE IF NO NULL
C920 86 20 LDAA #$20 *SPACE
782: Symbol Undefined on Pass 2
782: Warning --- Indexed Addressing Assumed
C922 A7 00 STAA B,TEMP1 *TEMPXX IS ACSII NOW
C924 8B 30 SKPBLK ADDA #$30 *CONVERT TO ASCII
785: Symbol Undefined on Pass 2
785: Warning --- Indexed Addressing Assumed
C926 A6 00 LDAA B,TEMP1
C928 5C INCB
C929 C1 03 CMPB #$03
C92B 27 EF BEQ LOOPBCD
C92D 39 RTS
C92E 18 1D 03 02 FLASHLED: BCLR 3,Y $02 *ENABLE (LOWER) CS LINE TO LASER 1 CONTROL
C932 B6 10 29 LDAA $1029 *CLEAR SPI INTERRUPT BIT
C935 96 15 LDAA LCONTROL
C937 88 08 EORA #$08 *IF LED IS ON, TURN IT OFF, AND VICE-VERSA
C939 97 15 STAA LCONTROL
C93B B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C93E B6 10 29 SPI1: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C941 84 80 ANDA #$80 *CHECK SPI FLAG
C943 27 F9 BEQ SPI1 *LOOP TILL DONE
C945 18 1C 03 02 BSET 3,Y $02 *DISABLE (RAISE) CS LINE TO LASER 1 CONTROL
C949 BD C8 AF JSR DELAY2
C94C 18 1D 03 02 BCLR 3,Y $02 *ENABLE (LOWER) CS LINE TO LASER 1 CONTROL
C950 B6 10 29 LDAA $1029 *CLEAR SPI INTERRUPT BIT
C953 96 15 LDAA LCONTROL
C955 88 08 EORA #$08 *IF LED IF OFF, TURN IT ON, AND VICE-VERSA
C957 97 15 STAA LCONTROL
C959 B7 10 2A STAA $102A *TRANSMIT ON SPI TO LASER T SHIFT REGISTER
C95C B6 10 29 SPI5: LDAA $1029 *IS SPI TRANSMIT FINISHED?
C95F 84 80 ANDA #$80 *CHECK SPI FLAG
C961 27 F9 BEQ SPI5 *LOOP TILL DONE
C963 18 1C 03 02 BSET 3,Y $02 *DISABLE (RAISE) CS LINE TO LASER 1 CONTROL
C967 BD C8 AF JSR DELAY2
C96A 39 RTS

 

Return to 68HC11 Start Page