COMMENT * -------------------------------------------------------------------------------- SDSUII Timing Board DSP code for EEV42-90 single output - CFHT's DetI -------------------------------------------------------------------------------- DetI Initial revision: Oct. 1998 - J.-C. Cuillandre (CFHT) jcc@cfht.hawaii.edu -> Based on Rev. 3.00 file provided by B. Leach -> ltb_CCID20.asm runs 2 CCDs MIT/LL CCDI20 2Kx4K -> Detector readout routine supports binning and sub-rastering -> Implementation of the dithering anti-blooming (with option bit) -> Generation of a test pattern to check system not using SXMIT -> Enhanced code readability -> IDLE mode disabled -------------------------------------------------------------------------------- EEV42-90 initial revision: .... ; Based on ltb_CCID20.asm to read two CCDs ; Initial revision - jamey@cfht.hawaii.edu - 04/99 ; This file contains the waveforms for reading out the EEV42-90 CCD in ; single readout mode of the Left or Right amplifier. It also contains ; the different VDELAY and gain settings for reading out on Gecko (250 columns ; x 4608 rows), and for normal full frame readout, 2048 x 4608. ; The linearity is less then 0.5% for both settings, while the noise ; for Gecko is < 4 electrons, and full frame is between 5 and 6 electrons. ;=============================================================================== This file is used to generate DSP code for the 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. Information from the EEV 42-90 chip: : P-> 1 4.5K lines imaging P-> 2 P-> 3 -------- 4 pre-scan pixels <------------------->| | | | |OG|SW|S2|S1|S3|...|S2|S1|S3|S2|S1|S3|S2|S1|S3|..|S3|S2|S1|SW|OG| | | OD _|_ _| _| |_| RG-|_ |_ | | RD SO LEFT output on this side RIGHT output (same structure) To go from one output to the other, switch DAC address for S1 and S2 * PAGE 132 ; Printronix page width - 132 columns ;=============================================================================== ; Define a section name so it doesn't conflict with other application programs SECTION EEV1E ; These are also defined in "timboot.asm", so be sure they agree APL_NUM EQU 0 ; Application number from 0 to 3 APL_ADR EQU $10A ; 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 ; board OPTIONS bits, defined at Y: Wait States RSTWDT EQU $6000 ; Address to reset the timing board watchdog timer ; ADC addressing code ADCQ1 EQU $FFA0 ; Address for reading A/D Q1 ADCQ2 EQU $FFA1 ; Address for reading A/D Q2 ADCQ3 EQU $FFA2 ; Address for reading A/D Q3 ADCQ4 EQU $FFA3 ; Address for reading A/D Q4 ADCQ5 EQU $FFA4 ; Address for reading A/D Q5 ADCQ6 EQU $FFA5 ; Address for reading A/D Q6 ; Define mosaic quadrant (output) selection codes QUAD=0x3F for all 6 quadrants Q1 EQU 0 ; Quadrant 1 QUAD=0x01 Q2 EQU 1 ; Quadrant 2 QUAD=0x02 Q3 EQU 2 ; Quadrant 3 QUAD=0x04 Q4 EQU 3 ; Quadrant 4 QUAD=0x08 Q5 EQU 4 ; Quadrant 5 QUAD=0x10 Q6 EQU 5 ; Quadrant 6 QUAD=0x20 ; All video boards with same SWITCH jumpers configuration: 1 add for all VIDEO EQU $000000 ; Video processor board select All ; Video board bias DAC selection - individual board selection ; Jumper configuration for DACs is as follow (4 jumpers bank 0->3, X for SET): ; DAC Jumpers: 0 1 2 3 Address ; Video1 ID0: X X X X 0000 ; Video2 ID1: X X X 1000 ; Video3 ID2: X X X 2000 BIAS1 EQU $000000 ; Video processor board #1 BIAS2 EQU $001000 ; Video processor board #2 ; Board clocking bank selection - bank1={clk 0 -> 11} bank2={clk 11 -> 23} ; DUAL mode set, only bank1 needs to be addressed ; All clocking boards with same SWITCH jumpers configuration: 1 add for all ; SWITCH jumpers must be for address $004000: ; SWITCH Jumpers: 1 2 3 Address ; like DAC1 => X X 4000 CLK EQU $002000 ; Clock driver all boards (same as DAC1 - ID4) ; Board clocking DAC selection - individual board selection ; Jumper configuration for DACs is as follow (4 jumpers bank 0->6, X for SET): ; There are two banks per board, system knows that +1 as to be added. ; DAC Jumpers: 0 1 2 3 Address ; Clock1 ID4: X X X 4000 ; Clock2 ID6: X X 6000 ; Clock3 ID8: X X X 8000 DAC1 EQU $002000 ; Clock driver board #1 select = ID4 for bank 1 ;DAC1 EQU $004000 ; Clock driver board #1 select = ID4 for bank 1 ;DAC2 EQU $006000 ; Clock driver board #2 select = ID6 for bank 1 DAC3 EQU $008000 ; Clock driver board #3 select = ID8 for bank 1 ; Delays ! Only the first two digits over the six. MAX=5.8us ; ! Non linear scale: 16=0.5 23=0.8 2F=1us BC=10us FF=20us PDELAY EQU $FF0000 ; Parallel clock delay = 5.8 microsec SDELAY EQU $200000 ; Serial clock delay = 0.4 microsec was 20 RDELAY EQU $070000 ; Reset clock delay = 0.2 microsec ; Full frame setting ;VDELAY EQU $2D0000 ; Video integration time = 1.0 microsec ; Gecko slow readout setting VDELAY EQU $B80000 ; Video integration time = 9.1 microsec NDELAY EQU $000000 ; No Delay ; Bias voltage definition GAININT EQU $C3000 ; Gain and integration speed INOFFA EQU $C0000 ; Input offset for channel A INOFFB EQU $C8000 ; Input offset for channel B OUTOFFA EQU $C4000 ; Input offset for channel A OUTOFFB EQU $CC000 ; Input offset for channel B ; Define DC bias voltages ;---------------------------------------------------------- ; Name Address Bias Description CCD Pin ;---------------------------------------------------------- VODL EQU $D0000 ; VOD = Output Drain A 1 VODR EQU $D4000 ; VOD = Output Drain B 2 VRDL EQU $D8000 ; VRD = Reset Drain A 3 VRDR EQU $DC000 ; VRD = Reset Drain B 4 VDD EQU $E0000 ; VDD = Dump Drain A 5 VOG1 EQU $F0000 ; VOG = Output Gate A 9 VOG2 EQU $F4000 ; VOG = Output Gate B 10 ;---------------------------------------------------------- ; Switch state bits for the CCD A & B clocks -> both banks (synchroneous) ;--------------------------------------------------------------------------------- ; Signal --- DAC --- Pin bank A - Pin bank B - Description ;--------------------------------------------------------------------------------- RGL EQU 0 ; 1 - Reset output node RGH EQU $1 S1LL EQU 0 ; 2 - Serial register, phase 1 Left S1LH EQU $2 S1RL EQU 0 ; 3 - Serial register, phase 1 Right S1RH EQU $4 S2LL EQU 0 ; 4 - Serial register, phase 2 Left S2LH EQU $8 S2RL EQU 0 ; 5 - Serial register, phase 2 Right S2RH EQU $10 S3L EQU 0 ; 6 - Serial register, phase 3 S3H EQU $20 SWLL EQU 0 ; 7 - Summing well Left SWLH EQU $40 SWRL EQU 0 ; 8 - Summing well Right SWRH EQU $80 P1L EQU 0 ; 9 - Parallel register phase 1 P1H EQU $100 P2L EQU 0 ; 10 - Parallel register phase 2 P2H EQU $200 P3L EQU 0 ; 11 - Parallel register phase 3 P3H EQU $400 DGL EQU 0 ; 12 - Dump Gate DGH EQU $800 ;--------------------------------------------------------------------------------- ; CCD clock voltage definitions ; Range: -10V ($000) -> +10V ($FFF) ~ $CC per volt ;-------------------------------------------------------------- ; Name Value Description Voltage (volts) ;-------------------------------------------------------------- ;Settings for using logic analyzer, 0 to +5V ;R_HI EQU $C00 ; Reset clock High +05.0 ;R_LO EQU $800 ; Reset clock Low 0.0 ;S_HI EQU $C00 ; Serial clocks High +05.0 ;S_LO EQU $800 ; Serial clocks Low 0.0 ;W_HI EQU $C00 ; Summing Well High +05.0 ;W_LO EQU $800 ; Summing Well Low 0.0 ;P_HI EQU $C00 ; Parallel High +05.0 ;P_LO EQU $800 ; Parallel Low 0.0 ;-------------------------------------------------------------- R_HI EQU $D60 ; Reset clock High +6.80 R_LO EQU $700 ; Reset clock Low -1.20 ;S_HI EQU $C00 ; Serial clocks High +5.00 ;S_LO EQU $400 ; Serial clocks Low -5.00 S_HI EQU $D80 ; Serial clocks High D00 fixes CTE prob. (not the trap) S_LO EQU $180 ; Serial clocks Low 280 fixes CTE prob. (not the trap) W_HI EQU $C00 ; Summing Well High +5.00 W_LO EQU $400 ; Summing Well Low -5.00 P_HI EQU $99A ; Parallel High +2.00 P_LO EQU $335 ; Parallel Low -6.00 ; Misc definitions 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 SYNC EQU 11 ; Master/Slave synchronization bit ; SXMIT values: for use with GenII host system only SXMIT EQU $00F021 ; $00F0A0 Series transmit A/D channels #0 to #5 ; $00F060 Series transmit A/D channels #0 to #3 ; $00F020 Series transmit A/D channels #0 to #1 ; $00F062 Series transmit A/D channels #2 to #3 ; $00F000 Series transmit A/D channel #0 ; $00F021 Series transmit A/D channel #1 ; $00F042 Series transmit A/D channel #2 ; $00F063 Series transmit A/D channel #3 ; $00F084 Series transmit A/D channel #4 ; $00F0A5 Series transmit A/D channel #5 ;************************************************************************** ; * ; Permanent address register assignments * ; S1 - Address of SSI receiver contents * ; S2 - Address of SCI receiver contents * ; S3 - 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 ;=============================== ;== MASTER/SLAVE TIMING BOARD == ;=============================== ; Master timing board. First lines must match boot code (ltb_masterboot.asm) IDLE JMP P2 during integration (dithering antiblooming) DITHER MOVE #=$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 (don't put code needing speed performances ; here), 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 ;=========== ;== SNDTP == ;=========== ; Send out test pattern data over the fiber - imaging area SNDTP MOVE X: 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 $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 3x 24 bits words (3x16bits of actual information) ; Reason: 8 higner bits of the 24 bits word eaten by CFH12K interface SDATA MOVE X: switch open) VPROC DC SSKIP-VPROC-2 ; left amp ; DC SXMIT ; Transmit A/D data to host ; DC VIDEO+NDELAY+%1110111 ; Stop resetting integrator ; DC VIDEO+NDELAY+%1110111 ; Stop resetting integrator ; DC VIDEO+VDELAY+%0000111 ; Integrate for 1 microsec ; DC VIDEO+NDELAY+%0011011 ; Stop Integrate ; DC CLK+$200000+P1H+P2L+P3L+DGL+RGL+S1LH+S1RL+S2LL+S2RH+S3L+SWLL+SWRL ; DC VIDEO+NDELAY+%1110111 ; Stop resetting integrator ; DC VIDEO+NDELAY+%0011011 ; Delay for signal to settle ; DC VIDEO+VDELAY+%0001011 ; Integrate for another microsec ; DC VIDEO+NDELAY+%0011011 ; Stop integrate, A/D is sampling ; DC CLK+SDELAY+P1H+P2L+P3L+DGL+RGL+S1LH+S1RH+S2LH+S2RH+S3L+SWLL+SWRL ; right amp DC SXMIT ; Transmit A/D data to host DC VIDEO+NDELAY+%1110111 ; Stop resetting integrator DC VIDEO+NDELAY+%1110111 ; Stop resetting integrator DC VIDEO+VDELAY+%0000111 ; Integrate for 1 microsec DC VIDEO+NDELAY+%0011011 ; Stop Integrate DC CLK+$200000+P1H+P2L+P3L+DGL+RGL+S1LL+S1RH+S2LH+S2RL+S3L+SWLL+SWRL DC VIDEO+NDELAY+%1110111 ; Stop resetting integrator DC VIDEO+NDELAY+%0011011 ; Delay for signal to settle DC VIDEO+VDELAY+%0001011 ; Integrate for another microsec DC VIDEO+NDELAY+%0011011 ; Stop integrate, A/D is sampling DC CLK+SDELAY+P1H+P2L+P3L+DGL+RGL+S1LH+S1RH+S2LH+S2RH+S3L+SWLL+SWRL ;=========== ;== SSKIP == ;=========== ; Serial clocking waveform for skipping SSKIP DC DACS-SSKIP-2 ; right amp DC CLK+RDELAY+P1H+P2L+P3L+DGL+RGH+S1LH+S1RL+S2LL+S2RH+S3L+SWLL+SWRL DC CLK+NDELAY+P1H+P2L+P3L+DGL+RGL+S1LH+S1RL+S2LL+S2RH+S3L+SWLL+SWRL DC CLK+NDELAY+P1H+P2L+P3L+DGL+RGL+S1LH+S1RL+S2LL+S2RH+S3H+SWLL+SWRH DC CLK+NDELAY+P1H+P2L+P3L+DGL+RGL+S1LL+S1RL+S2LL+S2RL+S3H+SWLL+SWRH DC CLK+NDELAY+P1H+P2L+P3L+DGL+RGL+S1LL+S1RH+S2LH+S2RL+S3H+SWLL+SWRH DC CLK+NDELAY+P1H+P2L+P3L+DGL+RGL+S1LL+S1RH+S2LH+S2RL+S3L+SWLL+SWRH DC CLK+NDELAY+P1H+P2L+P3L+DGL+RGL+S1LL+S1RH+S2LH+S2RL+S3L+SWLL+SWRL DC CLK+NDELAY+P1H+P2L+P3L+DGL+RGL+S1LH+S1RH+S2LH+S2RH+S3L+SWLL+SWRL ;========== ;== DACS == ;========== ; Initialization of clock driver and video processor DACs and switches DACS DC END_DACS-DACS-1 ; DAC Clocking Boards 1 ->{CCD1,CCD2} CCD A & CCD B ; Device A DC (DAC1<<8)+(00<<14)+R_HI ; pin 1 - CCD A - RG High DC (DAC1<<8)+(01<<14)+R_LO ; CCD A - RG Low DC (DAC1<<8)+(02<<14)+S_HI ; pin 2 - CCD A - S1L High DC (DAC1<<8)+(03<<14)+S_LO ; CCD A - S1L Low DC (DAC1<<8)+(04<<14)+S_HI ; pin 3 - CCD A - S1R High DC (DAC1<<8)+(05<<14)+S_LO ; CCD A - S1R Low DC (DAC1<<8)+(06<<14)+S_HI ; pin 4 - CCD A - S2L High DC (DAC1<<8)+(07<<14)+S_LO ; CCD A - S2L Low DC (DAC1<<8)+(08<<14)+S_HI ; pin 5 - CCD A - S2R High DC (DAC1<<8)+(09<<14)+S_LO ; CCD A - S2R Low DC (DAC1<<8)+(10<<14)+S_HI ; pin 6 - CCD A - S3 High DC (DAC1<<8)+(11<<14)+S_LO ; CCD A - S3 Low DC (DAC1<<8)+(12<<14)+W_HI ; pin 7 - CCD A - SWL High DC (DAC1<<8)+(13<<14)+W_LO ; CCD A - SWL Low DC (DAC1<<8)+(14<<14)+W_HI ; pin 8 - CCD A - SWR High DC (DAC1<<8)+(15<<14)+W_LO ; CCD A - SWR Low DC (DAC1<<8)+(16<<14)+P_HI ; pin 9 - CCD A - P1 High DC (DAC1<<8)+(17<<14)+P_LO ; CCD A - P1 Low DC (DAC1<<8)+(18<<14)+P_HI ; pin 10 - CCD A - P2 High DC (DAC1<<8)+(19<<14)+P_LO ; CCD A - P2 Low DC (DAC1<<8)+(20<<14)+P_HI ; pin 11 - CCD A - P3 High DC (DAC1<<8)+(21<<14)+P_LO ; CCD A - P3 Low DC (DAC1<<8)+(22<<14)+R_HI+$200 ; pin 12 - CCD A - DG High DC (DAC1<<8)+(23<<14)+R_LO ; CCD A - DG Low ; Device B DC (DAC1<<8)+(24<<14)+R_HI ; pin 13 - CCD B - RG High DC (DAC1<<8)+(25<<14)+R_LO ; CCD B - RG Low DC (DAC1<<8)+(26<<14)+S_HI ; pin 14 - CCD B - S1 High DC (DAC1<<8)+(27<<14)+S_LO ; CCD B - S1 Low DC (DAC1<<8)+(28<<14)+S_HI ; pin 15 - CCD B - S2 High DC (DAC1<<8)+(29<<14)+S_LO ; CCD B - S2 Low DC (DAC1<<8)+(30<<14)+S_HI ; pin 16 - CCD B - S3 High DC (DAC1<<8)+(31<<14)+S_LO ; CCD B - S3 Low DC (DAC1<<8)+(32<<14)+P_HI ; pin 17 - CCD B - P1 High BOTTOM DC (DAC1<<8)+(33<<14)+P_LO ; CCD B - P1 Low BOTTOM DC (DAC1<<8)+(34<<14)+P_HI ; pin 18 - CCD B - P2 High BOTTOM DC (DAC1<<8)+(35<<14)+P_LO ; CCD B - P2 Low BOTTOM DC (DAC1<<8)+(36<<14)+P_HI ; pin 19 - CCD B - P3 High BOTTOM DC (DAC1<<8)+(37<<14)+P_LO ; CCD B - P3 Low BOTTOM DC (DAC1<<8)+(38<<14)+W_HI ; pin 33 - CCD B - SW High LEFT DC (DAC1<<8)+(39<<14)+W_LO ; CCD B - SW Low LEFT DC (DAC1<<8)+(40<<14)+W_HI ; pin 34 - CCD B - SW High RIGHT DC (DAC1<<8)+(41<<14)+W_LO ; CCD B - SW Low RIGHT DC (DAC1<<8)+(42<<14)+P_HI ; pin 35 - CCD B - P1 High TOP DC (DAC1<<8)+(43<<14)+P_LO ; CCD B - P1 Low TOP DC (DAC1<<8)+(44<<14)+P_HI ; pin 36 - CCD B - P2 High TOP DC (DAC1<<8)+(45<<14)+P_LO ; CCD B - P2 Low TOP DC (DAC1<<8)+(46<<14)+P_HI ; pin 37 - CCD B - P3 High TOP DC (DAC1<<8)+(47<<14)+P_LO ; CCD B - P3 Low TOP ; Set gain and integrator speed. x 9.5 gain, fast integrate - All boards ; For fullframe fast readout at 2D integration times ; DC (BIAS1<<8)+GAININT+$FEE ; Gain, integrate speed, board #1 fast x 10 ; this one gives about the same gain as the Gecko setting ; DC (BIAS1<<8)+GAININT+$FDD ; Gain, integrate speed, board #1 fast x 4.75 ; DC (BIAS1<<8)+GAININT+$C77 ; Gain, integrate speed, board #1 slow x 1 ; For Gecko with B8 as integration times DC (BIAS1<<8)+GAININT+$CBB ; Gain, integrate speed, board #1 slow x 2 ; Input offset voltages for DC coupling - All boards - Target U4#6=24 volts DC (BIAS1<<8)+INOFFA+$800 ; Input offset, CCD A board #1 DC (BIAS1<<8)+INOFFB+$800 ; Input offset, CCD B board #1 ; Output offset voltages to get offset on bias frame - All boards DC (BIAS1<<8)+OUTOFFA+$700 ; Output offset, CCD A, board #1 DC (BIAS1<<8)+OUTOFFB+$840 ; Output offset, CCD B, board #1 ~500 ADU ; DC bias voltages: VOD, VRD, VOG ; Amplifier voltages - First board {CCD1,CCD2} ; LEFT AMP DC (BIAS1<<8)+VODL+$AAA ; VODL = ???V - CCD A, board #1 B3E best DC (BIAS1<<8)+VRDL+$5FE ; VRDL = ??? V - CCD A, board #1 806 best DC (BIAS1<<8)+VDD+$C30 ; VDD = 16.0 V - CCD A, board #1 C30 DC (BIAS1<<8)+VOG1+$185 ; VOG1 = -4.0 V - CCD A, board #1 ; RIGHT AMP DC (BIAS1<<8)+VODR+$AAA ; VODR = 22.5V - CCD B, board #1 ??? DC (BIAS1<<8)+VRDR+$5FE ; VRDR = 10.62V - CCD B, board #1 ??? DC (BIAS1<<8)+VOG2+$380 ; VOG2 = -3.0 V - CCD B, board #1 END_DACS ;=============================================================================== ; 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 EEV1E ; End of program END