; This file is for utilities that are in common to all the timing board ; programs, located starting at P:$200 in external SRAM COMMENT * The following commands are supported in this "timmisc.asm" file PAL_DLY Subroutine to delay by about 8 microseconds SET_DAC Transfer DAC values in (R0) table to the DACs FASTSKP Compute number of waveform table entries in a readout for fast clocking SYNTHETIC_IMAGE Generate a synthetic image for system testing OSHUT Subroutine call for opening the shutter CSHUT Subroutine call for closing the shutter OPEN_SHUTTER Command for opening the shutter CLOSE_SHUTTER Command for closing the shutter SET_EXP_TIME Write desired exposure time to timing board variable RD_EXP_TIME Read elapsed exposure time START_EXPOSURE Start an exposure - 'DON' reply, clear FPA, open shutter, expose, close shutter, delay Y:SH_DLY, readout PAUSE_EXPOSURE Close shutter, stop exposure timer RESUME_EXPOSURE Open shutter if necessary, resume exposure timer ABORT_EXPOSURE Close shutter, stop exposure timer IDL Put FPA to clocking when not processing commands or reading out STP Put FPA to not clocking when not processing commands or reading out READ_CONTROLLER_CONFIGURATION PWR_OFF Turn off ananlog power supply voltages to backplane PWR_ON Turn on ananlog power supply voltages to backplane SETBIAS Command to call SET_BIASES and reply 'DON' SET_BIASES Subroutine to turn on all bias and clock voltages by reading them from the waveform tables and writing them to the DACs SER_ANA Direct the timing board DSP's synchronous serial transmitter to the analog boards (clock driver, video) SER_UTL Direct the timing board DSP's synchronous serial transmitter to the utility board CLR_SWS Clear the analog switches in the clock driver and video boards to lower their power consumption, as a command with a 'DON' reply CLEAR_SWITCHES A subroutine call for CLR_WSW ST_GAIN Set the video processor gain to one of four values WR_CNTRL SET_DC SET_BIAS_NUMBER SET_MUX * ; ** Place this file after the custom timmisc.asm file so it continues ; to be written in the P:$200 address space **** ; Hardware control bit definitions SHUTTER EQU 4 ; Shutter control bit = TIM-LATCH0, A30 ; Delay for serial writes to the PALs and DACs by 8 microsec PAL_DLY DO #250,DLY ; Wait 8 usec for serial data transmission NOP DLY NOP RTS ; Update the DACs SET_DAC MOVE Y:(R0)+,X0 ; Get the number of table entries DO X0,SET_L0 ; Repeat X0 times MOVEP Y:(R0)+,X:SSITX ; Send out the waveform JSR 1.0 microsec per pixel NOP ; Increment pixel counts by one MOVE X: Power reset BSET #PWRST,X:PBD BSET #HVEN,X:PBD JMP Turn on +/- 6.5V, BCLR #PWRST,X:PBD MOVE #60000,X0 DO X0,WT_PON1 ; Wait 10 millisec or so for settling MOVE A,P:RSTWDT ; Reset watchdog timer MOVE A,P:RSTWDT WT_PON1 ; Ramp up the high +36 volt power line and then delay BCLR #HVEN,X:PBD ; HVEN = Low => Turn on +36V MOVE #60000,X0 DO X0,WT_PON2 ; Wait 10 millisec or so for settling MOVE A,P:RSTWDT ; Reset watchdog timer MOVE A,P:RSTWDT WT_PON2 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_SBI1 JSR utility board communication RTS ; Enable serial communication to the analog boards SER_ANA BSET #0,X:PBD ; Set H0 for analog boards SSI MOVEP #$0000,X:PCC ; Software reset of SSI BCLR #10,X:CRB ; SSI -> continuous clock for analog MOVEP #$0160,X:PCC ; Re-enable the SSI RTS ; Enable serial communication to the utility board SER_UTL MOVEP #$0000,X:PCC ; Software reset of SSI BSET #10,X:CRB ; SSI -> gated clock for util board MOVEP #$0160,X:PCC ; Enable the SSI BCLR #0,X:PBD ; Clear H0 for utility board SSI RTS CLR_SWS 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:24,X0 ; Check for argument less than 32 CMP X0,A JGE ERR_SM1 MOVE A,B MOVE #>7,X0 AND X0,B MOVE #>$18,X0 AND X0,A JNE $08,X0 CMP X0,A ; Test for 8 <= MUX number <= 15 JNE $10,X0 CMP X0,A ; Test for 16 <= MUX number <= 23 JNE 24,X0 ; Check for argument less than 32 CMP X0,A JGE ERR_SM2 REP #6 LSL A MOVE A,B MOVE #$1C0,X0 AND X0,B MOVE #>$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