COMMENT * This file is used to generate DSP code for the TIMII second generation timing board. This is Rev. 3.00 software. Timing modified for Datel A/D converter starting 11-6-96 Modified for timing board Rev. 4B Feb. 17, 1997 Put rarely used and non-time critical routines in SRAM program memory (P: > $200) -d DOWNLOAD 1 To generate code for downloading to DSP memory. -d DOWNLOAD 0 To generate code for writing to the EEPROM. * PAGE 132 ; Printronix page width - 132 columns ; Define a section name so it doesn't conflict with other application programs SECTION TIMTEST ; These are also defined in "timboot.asm", so be sure they agree APL_NUM EQU 3 ; Application number from 0 to 3 APL_ADR EQU $110 ; P: memory location where application code begins APL_LEN EQU $200-APL_ADR ; Maximum length of application program COM_TBL EQU $80 ; Starting address of command table in X: memory N_W_APL EQU $500 ; Number of words in each application ; Board status bits, defined at X: clocking out IDLMODE EQU 1 ; Set if need to idle after readout ST_RDC EQU 4 ; Set if executing 'RDC' command - reading out ; Define some timing board addresses WRLATCH EQU $FFC1 ; Write to timing board latch WRFO EQU $FFC0 ; Write to fiber optic transmitter RDAD0 EQU $FFA0 ; Address for reading A/D #0 RDAD1 EQU $FFA1 ; Address for reading A/D #1 SSIRX EQU $FFEF ; SSI Transmit and Receive data register SSITX EQU $FFEF ; SSI Transmit and Receive data register SSISR EQU $FFEE ; SSI Status Register PBD EQU $FFE4 ; Port B Data Register PCC EQU $FFE1 ; Port C Control Register PCDDR EQU $FFE3 ; Port C Data Direction Register PCD EQU $FFE5 ; Port C Data Register BCR EQU $FFFE ; Bus (=Port A) Control Register -> Wait States RSTWDT EQU $6000 ; Address to reset the timing board watchdog timer ; CCD clock voltage definitions VIDEO EQU $000000 ; Video processor board select = 0 CLK EQU $002000 ; Clock driver board select = all boards for clocks CLK2 EQU $002000 ; Clock driver board select = 2 for DAC setting CLK3 EQU $003000 ; Clock driver board select = 3 for DAC setting CLK4 EQU $004000 ; Clock driver board select = 4 for DAC setting P_DELAY EQU $020000 ; Parallel clock delay R_HI EQU 3000 ; Reset and Serial clocks High +4.0 volts R_LO EQU 770 ; Reset and Serial clocks Low -6.0 volts SI_HI EQU 2710 ; Storage and Image High +3.0 volts SI_LO EQU 620 ; Storage and Image Low -7.0 volts WW EQU 1 ; Word width = 1 for 16-bit image data, 0 for 24-bit CDAC EQU 0 ; Bit number in U25 for clearing DACs DUALCLK EQU 1 ; Set to clock two halves of clock driver board together ENCK EQU 2 ; Bit number in U25 for enabling analog switches FD15 EQU 10 ; Forced data bit 15 FMODE EQU 12 ; Forced data bit 15 mode ;SXMIT EQU $00F060 ; Series transmit A/D channels #0 to #3 ;SXMIT EQU $00F020 ; Series transmit A/D channels #0 to #1 ;SXMIT EQU $00F000 ; Series transmit A/D channel #0 only ;SXMIT EQU $00F021 ; Series transmit A/D channel #1 only ;SXMIT EQU $00F042 ; Series transmit A/D channel #2 only ;SXMIT EQU $00F063 ; Series transmit A/D channel #3 only ;SXMIT EQU $00F062 ; Series transmit A/D channels #2 to #3 ;SXMIT EQU $00F0A0 ; Series transmit A/D channels #0 to #5 ;SXMIT EQU $00F0E4 ; Series transmit A/D channels #4 to #7 ;SXMIT EQU $00F0E0 ; Series transmit A/D channels #0 to #7 ;SXMIT EQU $00F0A2 ; Series transmit A/D channels #2 to #5 SXMIT EQU $00F000 ;************************************************************************** ; * ; Permanent address register assignments * ; R1 - Address of SSI receiver contents * ; R2 - Address of SCI receiver contents * ; R3 - Pointer to current top of command buffer * ; R4 - Pointer to processed contents of command buffer * ; R5 - Temporary register for processing SSI and SCI contents * ; R6 - CCD clock driver address for CCD #0 = $FF80 * ; It is also the A/D address of analog board #0 * ; * ; Other registers * ; R0, R7 - Temporary registers used all over the place. * ; R5 - Can be used as a temporary register but is circular, * ; modulo 32. * ;************************************************************************** ; Specify execution and load addresses IF DOWNLOAD ORG P:APL_ADR,P:APL_ADR ; Download address ELSE ORG P:APL_ADR,P:APL_NUM*N_W_APL ; EEPROM address ENDIF ; Keep the CCD idling when not reading out IDLE DO Y: 1.0 microsec per pixel NOP ; Increment pixel counts by one MOVE X:=$200 WARN 'Application P: program is too large!' ; Make sure program ENDIF ; will not overflow ; **************** PROGRAM CODE IN SRAM PROGRAM SPACE ******************* ; Put all the following code in SRAM, starting at P:$200. IF DOWNLOAD ORG P:$200,P:$200 ; Download address ELSE ORG P:$200,P:APL_NUM*N_W_APL+APL_LEN ; EEPROM address ENDIF ; Set all the DC bias voltages and video processor offset values, reading ; them from the table labeled DACS in this file SETBIAS JSR OFF) MOVE #$000FFF,A MOVE A,X:(R6) ; Send out the waveform NOP ; Let the DAC voltages all ramp up before exiting MOVE #400,A ; Delay 4 millisec DO A,L_SBV1 JSR 1,X0 CMP X0,A ; Check for gain = x1 JNE $77,B JMP 2,X0 ; Check for gain = x2 CMP X0,A JNE $BB,B JMP 5,X0 ; Check for gain = x5 CMP X0,A JNE $DD,B JMP 10,X0 ; Check for gain = x10 CMP X0,A JNE $EE,B STG_A MOVE X:(R4)+,A ; Integrator Speed (0 for slow, 1 for fast) JCLR #0,A1,STG_B BSET #8,B1 BSET #9,B1 STG_B MOVE #$0C3C00,X0 OR X0,B MOVE B,Y:2,A ; High gain is x 2 MOVE A,X:(R3)+ MOVE X:1,A ; Low gain is x 1 MOVE A,X:(R3)+ MOVE X:7,X0 AND X0,B MOVE #>$18,X0 AND X0,A JNE $8,X0 CMP X0,A ; Test for 8 <= MUX number <= 15 JNE $10,X0 CMP X0,A ; Test for 16 <= MUX number <= 23 JNE $200,X0 CMP X0,A ; Test for 8 <= MUX number <= 15 JNE $400,X0 CMP X0,A ; Test for 16 <= MUX number <= 23 JNE switch open) SERIAL_IDLE DC SSKIP-SERIAL_IDLE-2 DC CLK+SI1L+SI2H+SI3L+RH+R1H+R2H+R3L DC VIDEO+$000000+%1110100 ; Change nearly everything DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2H+R3L DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2H+R3H DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2L+R3H DC CLK+SI1L+SI2H+SI3L+RL+R1H+R2L+R3H DC VIDEO+$000000+%1110111 ; Stop resetting integrator DC VIDEO+$2e0000+%0000111 ; Integrate for 1 microsec DC VIDEO+$000000+%0011011 ; Stop Integrate DC CLK+SI1L+SI2H+SI3L+RL+R1H+R2L+R3L DC VIDEO+$000000+%0011011 ; Delay for signal to settle DC VIDEO+$000000+%0011011 ; Delay for signal to settle DC VIDEO+$2c0000+%0001011 ; Integrate for another microsec DC VIDEO+$000000+%0001011 ; Continue integrating DC VIDEO+$000000+%0011000 ; Stop integrate, A/D is sampling ; Serial clocking waveform for skipping SSKIP DC DACS-SSKIP-2 DC CLK+SI1L+SI2H+SI3L+RH+R1H+R2L+R3L DC CLK+SI1L+SI2H+SI3L+RL+R1H+R2L+R3L DC CLK+SI1L+SI2H+SI3L+RL+R1H+R2H+R3L DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2H+R3L DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2H+R3H DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2L+R3H DC CLK+SI1L+SI2H+SI3L+RL+R1H+R2L+R3H DC CLK+SI1L+SI2H+SI3L+RL+R1H+R2L+R3L ; Initialization of clock driver and video processor DACs and switches DACS DC END_DACS-DACS-1 DC (CLK2<<8)+R_HI ; R High DC (CLK2<<8)+(1<<14)+R_LO ; R Low DC (CLK2<<8)+(2<<14)+SI_HI ; SI1 High DC (CLK2<<8)+(3<<14)+SI_LO ; SI1 Low DC (CLK2<<8)+(4<<14)+SI_HI ; SI2 High DC (CLK2<<8)+(5<<14)+SI_LO ; SI2 Low DC (CLK2<<8)+(6<<14)+SI_HI ; SI3 High DC (CLK2<<8)+(7<<14)+SI_LO ; SI3 Low DC (CLK2<<8)+(8<<14)+R_HI ; R1 High DC (CLK2<<8)+(9<<14)+R_LO ; R1 Low DC (CLK2<<8)+(10<<14)+R_HI ; R2 High DC (CLK2<<8)+(11<<14)+R_LO ; R2 Low DC (CLK2<<8)+(12<<14)+R_HI ; R3 High DC (CLK2<<8)+(13<<14)+R_LO ; R3 Low ; Set the DACs of the second clock driver board # 3 DC (CLK3<<8)+R_HI ; R High DC (CLK3<<8)+(1<<14)+R_LO ; R Low DC (CLK3<<8)+(2<<14)+SI_HI ; SI1 High DC (CLK3<<8)+(3<<14)+SI_LO ; SI1 Low DC (CLK3<<8)+(4<<14)+SI_HI ; SI2 High DC (CLK3<<8)+(5<<14)+SI_LO ; SI2 Low DC (CLK3<<8)+(6<<14)+SI_HI ; SI3 High DC (CLK3<<8)+(7<<14)+SI_LO ; SI3 Low DC (CLK3<<8)+(8<<14)+R_HI ; R1 High DC (CLK3<<8)+(9<<14)+R_LO ; R1 Low DC (CLK3<<8)+(10<<14)+R_HI ; R2 High DC (CLK3<<8)+(11<<14)+R_LO ; R2 Low DC (CLK3<<8)+(12<<14)+R_HI ; R3 High DC (CLK3<<8)+(13<<14)+R_LO ; R3 Low ; Set the DACs of the third clock driver board # 4 DC (CLK4<<8)+R_HI ; R High DC (CLK4<<8)+(1<<14)+R_LO ; R Low DC (CLK4<<8)+(2<<14)+SI_HI ; SI1 High DC (CLK4<<8)+(3<<14)+SI_LO ; SI1 Low DC (CLK4<<8)+(4<<14)+SI_HI ; SI2 High DC (CLK4<<8)+(5<<14)+SI_LO ; SI2 Low DC (CLK4<<8)+(6<<14)+SI_HI ; SI3 High DC (CLK4<<8)+(7<<14)+SI_LO ; SI3 Low DC (CLK4<<8)+(8<<14)+R_HI ; R1 High DC (CLK4<<8)+(9<<14)+R_LO ; R1 Low DC (CLK4<<8)+(10<<14)+R_HI ; R2 High DC (CLK4<<8)+(11<<14)+R_LO ; R2 Low DC (CLK4<<8)+(12<<14)+R_HI ; R3 High DC (CLK4<<8)+(13<<14)+R_LO ; R3 Low ; Set gain and integrator speed. x 9.5 gain, fast integrate DC $0c3fee ; Gain, integrate speed, board #0 DC $1c3fee ; Gain, integrate speed DC $2c3fee ; Gain, integrate speed DC $3c3fee ; Gain, integrate speed ; Input offset voltages for DC coupling. Target is U4#6 = 24 volts DC $0c0800 ; Input offset, ch. A DC $0c8800 ; Input offset, ch. B DC $1c0800 ; Input offset, ch. A, bd. #1 DC $1c8800 ; Input offset, ch. B, bd. #1 DC $2c0800 ; Input offset, ch. A, bd. #2 DC $2c8800 ; Input offset, ch. B, bd. #2 DC $3c0800 ; Input offset, ch. A, bd. #3 DC $3c8800 ; Input offset, ch. B, bd. #3 ; Output offset voltages to get around 1000 DN A/D units on a dark frame DC $0c46c0 ; Output video offset, ch. A DC $0cc6c0 ; Output video offset, ch. B DC $1c46c0 ; Output video offset, ch. A, bd. #1 DC $1cc6c0 ; Output video offset, ch. B, bd. #1 DC $2c46c0 ; Output video offset, ch. A, bd. #2 DC $2cc6c0 ; Output video offset, ch. B, bd. #2 DC $3c46c0 ; Output video offset, ch. A, bd. #3 DC $3cc6c0 ; Output video offset, ch. B, bd. #3 ; DC bias voltages for the EEV39 wavefront sensor CCD chip DC $0d0c8a ; Vod = 24.00 V, pin #2 DC $0d8719 ; Vrd = 11.00 V, pin #3 DC $0f8540 ; Vog = -3.4V pin #11 best CTE DC $1d0c8a ; Vod = 24.00 V, pin #1, bd. #1 DC $1f8540 ; Vog = -3.4V pin #11 best CTE, bd. #1 DC $2d0c8a ; Vod = 24.00 V, pin #1, bd. #2 DC $2f8540 ; Vog = -3.4V pin #11 best CTE, bd. #2 DC $3d0c8a ; Vod = 24.00 V, pin #1, bd. #3 DC $3f8540 ; Vog = -3.4V pin #11 best CTE, bd. #3 END_DACS ; Check for Y: data memory overflow IF @CVS(N,*)>$80 WARN 'Application Y: data memory is too large!' ; Make sure Y: ENDIF ; will not overflow ; The fast serial code with the circulating address register must start on ; a boundary that is a multiple of the address register modulus. ; Offset $2C0 leaves APL_LEN+$200 words for P: code, $20 wrods for commands, ; and $80 words for Y: waveforms above. IF DOWNLOAD ORG Y:$80,Y:$80 ; Download address ELSE ORG Y:$80,P:APL_NUM*N_W_APL+APL_LEN+$2C0 ; EEPROM address ENDIF ; xfer, A/D, integ, Pol+, Pol-, DCrestore, rst (1 => switch open) SERIAL DC CLK+SI1L+SI2H+SI3L+RH+R1H+R2H+R3L DC VIDEO+$000000+%1110100 ; Change nearly everything DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2H+R3L DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2H+R3H DC CLK+SI1L+SI2H+SI3L+RL+R1L+R2L+R3H DC CLK+SI1L+SI2H+SI3L+RL+R1H+R2L+R3H DC SXMIT ; Transmit A/D data to host DC VIDEO+$000000+%1110111 ; Stop resetting integrator DC VIDEO+$000000+%1110111 ; !!! Delay for signal to settle DC VIDEO+$2e0000+%0000111 ; Integrate for 1 microsec DC VIDEO+$000000+%0011011 ; Stop Integrate DC CLK+SI1L+SI2H+SI3L+RL+R1H+R2L+R3L DC VIDEO+$000000+%0011011 ; Delay for signal to settle DC VIDEO+$000000+%0011011 ; Delay for signal to settle DC VIDEO+$2e0000+%0001011 ; Integrate for another microsec DC VIDEO+$000000+%0011011 ; Stop integrate, A/D is sampling END_SERIAL ; Check for overflow in the EEPROM case IF !DOWNLOAD IF @CVS(N,@LCV(L))>(APL_NUM+1)*N_W_APL WARN 'EEPROM overflow!' ; Make sure next application ENDIF ; will not be overwritten ENDIF ENDSEC ; End of section TIMTEST ; End of program END