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 Rarely used and non-time critical code are 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. ; ph mods to setup different wipe comments to next line * PAGE 132 ; Printronix page width - 132 columns ; Define a section name so it doesn't conflict with other application programs SECTION TIM ; These are also defined in "timboot.asm", so be sure they agree APL_NUM EQU 1 ; Application number from 1 to 10 APL_ADR EQU $100 ; 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 ; 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 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 BD2 EQU $002000 ; Clock driver board select = 2 BD3 EQU $003000 ; Clock driver board select = 3 P_DELAY EQU $ff0000 ; Maximum delay for parallels = 25 microsec S_DELAY EQU $500000 ; Test serial 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 LVEN EQU 2 ; Low voltage PS enable (+/-15 volt nominal) HVEN EQU 3 ; Enable high voltage PS (+32V nominal)- Output PWRST EQU 13 ; Power control board reset SYNC EQU 11 ; Master/Slave synchronization bit CDAC EQU 0 ; Bit number in U25 for clearing DACs ENCK EQU 2 ; Bit number in U25 for enabling analog switches ;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 ; Single readout of the B amplifier SXMIT EQU $00F021 ;************************************************************************** ; * ; 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:(2*APL_NUM-1)*$100 ; EEPROM generation ENDIF ; Keep the CCD idling when not reading out IDLE DO Y: 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 =$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. Load Application is ; not yet supported ORG P:$200,P:$200 ; Download address ; Set the video processor gain and integrator speed for all video boards ; Command syntax is SGN #GAIN #SPEED, #GAIN = 1, 2, 5 or 10 ; #SPEED = 0 for slow, 1 for fast ST_GAIN 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 $10,X0 CMP X0,A ; Test for 8 <= MUX number <= 15 JNE $20,X0 CMP X0,A ; Test for 16 <= MUX number <= 23 JNE $600,X0 AND X0,A 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 BD3+S_DELAY+P1_H ; do I need this DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_H+SWA_L+RGA_H+S2B_H+S3B_L+SWB_L+RGB_H+P2_H+P3U_L+P3D_L DC VIDEO+$000000+%1110100 ; Change nearly everything DC BD2+S_DELAY+S1AB_L+S2A_L+S3A_H+SWA_L+RGA_H+S2B_H+S3B_L+SWB_L+RGB_H+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_H+SWA_H+RGA_L+S2B_H+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_L+SWA_H+RGA_L+S2B_L+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC SXMIT ; Transmit A/D data to host DC VIDEO+$000000+%1110111 ; Stop resetting integrator DC VIDEO+$000000+%1110111 ; Analog settling delay DC VIDEO+$500000+%0000111 ; Integrate for 1 microsec DC VIDEO+$000000+%0011011 ; Stop Integrate DC BD2+S_DELAY+S1AB_H+S2A_H+S3A_L+SWA_H+RGA_L+S2B_L+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_L+SWA_L+RGA_L+S2B_L+S3B_L+SWB_L+RGB_L+P2_H+P3U_L+P3D_L DC VIDEO+$000000+%0011011 ; Delay for signal to settle DC VIDEO+$000000+%0011011 ; Delay for signal to settle DC VIDEO+$500000+%0001011 ; Integrate for another microsec DC VIDEO+$000000+%0011011 ; Stop integrate, A/D is sampling ; Serial clocking waveform for skipping SSKIP DC DACS-SSKIP-2 ; DC BD3+S_DELAY+P1_H ; do I need this DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_H+SWA_L+RGA_H+S2B_H+S3B_L+SWB_L+RGB_H+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_L+S2A_L+S3A_H+SWA_L+RGA_H+S2B_H+S3B_L+SWB_L+RGB_H+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_H+SWA_H+RGA_L+S2B_H+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_L+SWA_H+RGA_L+S2B_L+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_H+S2A_H+S3A_L+SWA_H+RGA_L+S2B_L+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_L+SWA_L+RGA_L+S2B_L+S3B_L+SWB_L+RGB_L+P2_H+P3U_L+P3D_L ; Initialization of clock driver and video processor DACs and switches DACS DC END_DACS-DACS-1 DC (BD2<<8)+RG_HI ; RGA High DC (BD2<<8)+(1<<14)+RG_LO ; RGA Low DC (BD2<<8)+(2<<14)+RG_HI ; RGB High DC (BD2<<8)+(3<<14)+RG_LO ; RGB Low DC (BD2<<8)+(4<<14)+SW_HI ; SWa High DC (BD2<<8)+(5<<14)+SW_LO ; SWa Low DC (BD2<<8)+(6<<14)+SW_HI ; SWb High DC (BD2<<8)+(7<<14)+SW_LO ; SWb Low DC (BD2<<8)+(8<<14)+S_HI ; S1ab High DC (BD2<<8)+(9<<14)+S_LO ; S1ab Low DC (BD2<<8)+(10<<14)+S_HI ; S2a High DC (BD2<<8)+(11<<14)+S_LO ; S2a Low DC (BD2<<8)+(12<<14)+S_HI ; S2b High DC (BD2<<8)+(13<<14)+S_LO ; S2b Low DC (BD2<<8)+(14<<14)+S_HI ; S3a High DC (BD2<<8)+(15<<14)+S_LO ; S3a Low DC (BD2<<8)+(16<<14)+S_HI ; S3b High DC (BD2<<8)+(17<<14)+S_LO ; S3b Low DC (BD2<<8)+(18<<14)+P3_HI ; P3u High DC (BD2<<8)+(19<<14)+P3_LO ; P3u Low DC (BD2<<8)+(20<<14)+P3_HI ; P3D High DC (BD2<<8)+(21<<14)+P3_LO ; P3D Low DC (BD2<<8)+(22<<14)+P_HI ; P2 High DC (BD2<<8)+(23<<14)+P_LO ; P2 Low DC (BD2<<8)+(24<<14)+P_HI ; P1 High DC (BD2<<8)+(25<<14)+P_LO ; P1 Low DC (BD2<<8)+(26<<14)+P_HI ; Test High DC (BD2<<8)+(27<<14)+P_LO ; Test Low ; Set gain and integrator speed. x 9.5 gain, fast integrate DC $0c3fdd ; Gain, integrate speed, board #0 ; DC $0c3fee ; Gain, integrate speed, board #0 ; DC $0c3f77 ; Gain, integrate speed, board #0 x1 ; DC $0c3fbb ; Gain, integrate speed, board #0 x2 ; DC $0c3fdd ; Gain, integrate speed, board #0 x4.75 ; DC $0c3fee ; Gain, integrate speed, board #0 x9 ; Input offset voltages for DC coupling. Target is U4#6 = 24 volts DC $0c08a0 ; Input offset, ch. A DC $0c8b00 ; Input offset, ch. B ; Output offset voltages to get around 1000 DN A/D units on a dark frame ; values used for meltdown ; DC $0c4a90 ; Output video offset, ch. A ; DC $0cce70 ; Output video offset, ch. B ; dec sdsu values ; DC $0c4af2 ; Output video offset, ch. A ; DC $0cce7a ; Output video offset, ch. B ; new values feb22 correct for ac coupled ; DC $0c4825 ; Output video offset, ch. A ; DC $0ccfff ; Output video offset, ch. B ; new values feb22 correct for ac coupled, with zero ramp ; DC $0c4810 ; Output video offset, ch. A ; DC $0ccfff ; Output video offset, ch. B ; new values, dc coupled with video clamped during parallel ; DC $0c4800 ; Output video offset, ch. A ; DC $0ccfff ; Output video offset, ch. B ; newer values, dc coupled with video clamped during parallel ; DC $0c4803 ; Output video offset, ch. A ; DC $0ccc00 ; Output video offset, ch. B ; sdsu video card, dc coupled with video clamped during parallel ; DC $0c4b00 ; Output video offset, ch. A DC $0c4a00 ; Output video offset, ch. A DC $0cce00 ; Output video offset, ch. B ; DC $0cc790 ; Output video offset, ch. B ; DC $0c4500 ; Output video offset, ch. A ; DC $0cc000 ; Output video offset, ch. B ; DC bias voltages for the CCD chip ; as i found them ; DC $0d0c33 ; Vod #1 = 24.30 V, pin #1 ; DC $0d4c36 ; Vod #2 = 24.30 V, pin #2 ; DC $0d8a20 ; Vrd = 14.00 V, pin #3, converts to 14.45 ; DC $0d0c73 ; Vod #1 = 25.0 V, pin #1 ; DC $0d4c73 ; Vod #2 = 25.0 V, pin #2 ; DC $0d8a60 ; Vrd = 15.00 V, pin #3 ,dont exceed 16 = bbb ; DC $0dcbbb ; Vofd = 16 V, pin #4 ; DC $0f84cc ; Vlga = -4.0 V pin #11 ; DC $0fc4cc ; Vlgb = -4.0 V pin #12 ; DC bias voltages for the CCD chip DC $0d0c73 ; Vod #1 = 25.0 V, pin #1 DC $0d4c73 ; Vod #2 = 25.0 V, pin #2 DC $0d8a60 ; Vrd = 15.00 V, pin #3 ,dont exceed 16 = bbb DC $0dcd00 ; Vofd = 16 V, pin #4 ,converts to 17.1 DC $0f84c4 ; Vlga = -4.0 V pin #11 DC $0fc4c4 ; Vlgb = -4.0 V pin #12 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. IF DOWNLOAD ORG Y:$80,Y:$80 ; Download address ELSE ORG Y:$80,P:(2*APL_NUM-1)*$100+APL_LEN+$A0 ; EEPROM address ENDIF ; Fast Serials readout for single amp on RC chip ; xfer(01), A/D(01), integ, Pol+, Pol-, DCclamp, rst (1 => switch open) SERIAL DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_L+SWA_L+RGA_H+S2B_H+S3B_L+SWB_L+RGB_H+P2_H+P3U_L+P3D_L DC VIDEO+$000000+%0011011 ; settle before sample DC VIDEO+$000000+%1110100 ; xfer(pix n-1),a/d(pix n),pol,dcclamp,rst DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_L+SWA_L+RGA_H+S2B_H+S3B_L+SWB_L+RGB_H+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_H+SWA_H+RGA_L+S2B_H+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_L+S2A_L+S3A_H+SWA_H+RGA_L+S2B_L+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L DC SXMIT ; Transmit A/D data (pix n-1) to host DC VIDEO+$000000+%0010110 ; dcclamp off, pol+ DC VIDEO+$000000+%0010111 ; reset off DC VIDEO+$000000+%0010111 ; Analog settling delay DC VIDEO+$500000+%0000111 ; Integrate for 2 microsec DC VIDEO+$000000+%0010011 ; Stop Integrate DC VIDEO+$000000+%0011011 ; pol+ DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_H+SWA_H+RGA_L+S2B_L+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_L+SWA_L+RGA_L+S2B_L+S3B_L+SWB_L+RGB_L+P2_H+P3U_L+P3D_L DC VIDEO+$000000+%0011011 ; Delay for signal to settle DC VIDEO+$000000+%0011011 ; Delay for signal to settle DC VIDEO+$500000+%0001011 ; Integrate for another 2 microsec DC VIDEO+$000000+%0011011 ; Stop integrate, A/D is sampling ; B amp readout ;SERIAL DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_H+SWA_L+RGA_H+S2B_L+S3B_H+SWB_L+RGB_H+P2_H+P3U_L+P3D_L ; DC VIDEO+$000000+%0011011 ; settle before sample ; DC VIDEO+$000000+%1110100 ; xfer(pix n-1),a/d(pix n),pol,dcclamp,rst ; DC BD2+S_DELAY+S1AB_L+S2A_L+S3A_H+SWA_L+RGA_H+S2B_L+S3B_H+SWB_L+RGB_H+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_H+SWA_H+RGA_L+S2B_H+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_L+SWA_H+RGA_L+S2B_H+S3B_L+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC SXMIT ; Transmit A/D data (pix n-1) to host ; DC VIDEO+$000000+%0010110 ; dcclamp off, pol+ ; DC VIDEO+$000000+%0010111 ; reset off ; DC VIDEO+$000000+%0010111 ; Analog settling delay ; DC VIDEO+$500000+%0000111 ; Integrate for 2 microsec ; DC VIDEO+$000000+%0010011 ; Stop Integrate ; DC VIDEO+$000000+%0011011 ; pol+ ; DC BD2+S_DELAY+S1AB_H+S2A_H+S3A_L+SWA_H+RGA_L+S2B_H+S3B_L+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_L+SWA_L+RGA_L+S2B_L+S3B_L+SWB_L+RGB_L+P2_H+P3U_L+P3D_L ; DC VIDEO+$000000+%0011011 ; Delay for signal to settle ; DC VIDEO+$000000+%0011011 ; Delay for signal to settle ; DC VIDEO+$500000+%0001011 ; Integrate for another 2 microsec ; DC VIDEO+$000000+%0011011 ; Stop integrate, A/D is sampling END_SERIAL ; Serials for single readout of 0 amp, for amp 1 switch S2's and S3's ;works for amp A on the RC chip ;SERIAL DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_L+SWA_L+RGA_H+S2B_L+S3B_L+SWB_L+RGB_H+P2_H+P3U_L+P3D_L ; DC VIDEO+$000000+%1110100 ; Change nearly everything ; DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_L+SWA_L+RGA_L+S2B_L+S3B_L+SWB_L+RGB_L+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_H+SWA_H+RGA_L+S2B_L+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_L+S2A_L+S3A_H+SWA_H+RGA_L+S2B_L+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_H+SWA_H+RGA_L+S2B_H+S3B_H+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_L+S2A_H+S3A_L+SWA_H+RGA_L+S2B_H+S3B_L+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_H+S2A_H+S3A_L+SWA_H+RGA_L+S2B_H+S3B_L+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_L+SWA_H+RGA_L+S2B_L+S3B_L+SWB_H+RGB_L+P2_H+P3U_L+P3D_L ; DC SXMIT ; Transmit A/D data to host ; DC VIDEO+$000000+%1110111 ; Stop resetting integrator ; DC VIDEO+$000000+%1110111 ; Analog settling delay ; DC VIDEO+$500000+%0000111 ; Integrate for 1 microsec ; DC VIDEO+$000000+%0011011 ; Stop Integrate ; DC BD2+S_DELAY+S1AB_H+S2A_L+S3A_L+SWA_L+RGA_L+S2B_L+S3B_L+SWB_L+RGB_L+P2_H+P3U_L+P3D_L ; DC VIDEO+$000000+%0011011 ; Delay for signal to settle ; DC VIDEO+$000000+%0011011 ; Delay for signal to settle ; DC VIDEO+$500000+%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))>(2*APL_NUM+1)*$100 WARN 'EEPROM overflow!' ; Make sure next application ENDIF ; will not be overwritten ENDIF ENDSEC ; End of section TIM ; End of program END