COMMENT * This file is used to generate DSP code for the second generation timing boards to operate one 512 x 512 pixel quadrant of an Aladdin infrared array with two coadder boards. * PAGE 132 ; Printronix page width - 132 columns ; Define a section name so it doesn't conflict with other application programs SECTION TIM_ALADDIN ; Include a header file that defines global parameters INCLUDE "timhdr.asm" APL_NUM EQU 0 ; Application number from 0 to 3 CC EQU TIMREV4+NGST+COADDER SCR EQU $FFF0 ; SCI Control Register SSR EQU $FFF1 ; SCI Status Register SCCR EQU $FFF2 ; SCI Clock Control Register WRSCI EQU $FFF4 ; Write least significant byte to SCI port WRSCI0 EQU $FFF4 ; Write least significant byte to SCI port WRSCI1 EQU $FFF5 ; Write middle significant byte to SCI port WRSCI2 EQU $FFF6 ; Write most significant byte to SCI port SRAM_AD EQU $500 ; Address in timing board SRAM where coadder code is P_COADD EQU $E001 ; Start of coadder code in EEPROM RST_CA EQU 3 ; Timing board resets coadder board ; Software status bit definitions for the program only RST_MODE EQU 16 ; 0 for global reset, 1 for row-by-row reset CDS_MODE EQU 17 ; 0 for single sampling, 1 for CDS PTR_MODE EQU 18 ; 0 for Coadder arithmetic, 1 for pass through mode UTR_MODE EQU 19 ; 0 for normal, 1 up-the-ramp readout ; Specify execution and load addresses IF @SCP("DOWNLOAD","HOST") ORG P:APL_ADR,P:APL_ADR ; Download address ELSE ORG P:APL_ADR,P:APL_NUM*N_W_APL ; EEPROM address ENDIF ; Normal readout of array with global reset RD_ARRAY ; Read 256 cols x 512 rows MOVE #FRAME_INIT,R0 ; per coadder 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. IF @SCP("DOWNLOAD","HOST") ORG P:$200,P:$200 ; Download address ELSE ORG P:$200,P:APL_NUM*N_W_APL+APL_LEN ; ROM address ENDIF START_EXPOSURE MOVE X:8,A ; Not-CDS value = (512 x 512) / 8 JCLR #CDS_MODE,X:STATUS,XMIT MOVE #>16,A ; CDS value = 2 x (512 x 512) / 8 XMIT DO A,L_XTIM1 ; 32-bits per pixel MOVE #$1000,X0 ; For two coadder boards transmit DO X0,L_TXIM2 ; eight pixels per loop MOVE #$00F060,A ; Write SXMIT out MOVE A,X:(R6) MOVE #XMT_DLY,X0 ; Delay for pixel transmission MOVE X0,X:(R6) MOVE #$00F060,A MOVE A,X:(R6) MOVE #XMT_DLY,X0 MOVE X0,X:(R6) MOVE #$00F0E4,A MOVE A,X:(R6) MOVE #XMT_DLY,X0 MOVE X0,X:(R6) MOVE #$00F0E4,A MOVE A,X:(R6) MOVE #XMT_DLY,X0 MOVE X0,X:(R6) L_TXIM2 NOP L_XTIM1 JSR 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 Power reset BSET #PWRST,X:PBD ; PWRST = 1 => Power reset BSET #HVEN,X:PBD MOVE #TST_RCV,X0 MOVE X0,X: Power reset BSET #PWRST,X:PBD ; PWRST = 1 => Power reset BSET #HVEN,X:PBD ; Now ramp up the low voltages (+/- 6.5V, 16.5V) BCLR #LVEN,X:PBD ; LVEN = Low => Turn on +/- 6.5V, BCLR #PWRST,X:PBD ; +/- 16.5V MOVE X: Wait States PCC EQU $FFE1 ; Port C Control Register PCDDR EQU $FFE3 ; Port C Data Direction Register PCD EQU $FFE5 ; Port C Data Register CRA EQU $FFEC ; SSI Control Register A CRB EQU $FFED ; SSI Control Register B SSISR EQU $FFEE ; SSI Status Register SSIRX EQU $FFEF ; SSI Receiver SSITX EQU $FFEF ; SSI Transmitter PBC EQU $FFE0 ; Port B Control Register PBDDR EQU $FFE2 ; Port B Data Direction Register PBD EQU $FFE4 ; Port B Data Register PCTL EQU $FFFD ; PLL control register IPR EQU $FFFF ; Interrupt Priority Register SCR EQU $FFF0 SSR EQU $FFF1 SCCR EQU $FFF2 STXL EQU $FFF4 SRXL EQU $FFF4 SSI_TDE EQU 6 ; SSI Transmitter data register empty SSI_RDF EQU 7 ; SSI Receiver data register full RCV_ERR EQU 2 ; Place in X: memory for SSI errors ; Board addresses RDFIFO EQU $C000 ; Read A/D FIFO into DSP WRCAFIFO EQU $C001 ; Write from DSP to coadder FIFO RSTFIFO EQU $C002 ; Reset both A/D and coadder FIFOs RSTSRAM EQU $8000 ; Start 32-bit mode pointer with D0-D23 (X: memory) ; Parallel port bit numbers, Port B SRAMADDR16 EQU 4 ; SRAM address line 16 SRAMADDR17 EQU 5 ; SRAM address line 17 SRAMADDR18 EQU 6 ; SRAM address line 18 SRAMADDR19 EQU 7 ; SRAM address line 19 GAIN EQU 8 ; A/D gain EF EQU 9 ; Bit number of incomimng FIFO empty flag HF EQU 10 ; Bit number of incoming FIFO half full flag ; Define a little table for X: memory entries NCOADDS EQU X_TABLE NUTR EQU NCOADDS+1 CDS EQU NUTR+1 NFS EQU CDS+1 ; More flags, Port C M24_32 EQU 2 ; 24- or 32-bit coaddition, Port C CAHF EQU 5 ; Cadder FIFO half full flag, on Port C MEM_ERR EQU 3 ; Set if memory testing error ;************************************************************************** ; * ; Permanent address register assignments * ; R1 - Pointer to commands received pending processing * ; R2 - Pointer to processed commands * ; R3 - Pixel address of frame being coadded * ; R4 - Pixel address of frame being transmitted * ; R5 - RDFIFO address = $C000 * ; R6 - WRCAFIFO address = $C001 * ; * ;************************************************************************** ; Specify the load address for the coadder code IF @SCP("DOWNLOAD","HOST") ORG P:RST_ISR,P:$500 ; Download address ELSE ORG P:RST_ISR,P:RST_ISR+ROM_OFF ; ROM address ENDIF ; Special address for two words for downloading over coadder SCI port DC END_ADR ; Number of boot code words DC $0 ; Starting address of boot code ; After RESET jump to initialization code IF @SCP("DOWNLOAD","HOST") ORG P:RST_ISR,P:$500+2 ; Download address ELSE ORG P:RST_ISR,P:RST_ISR+ROM_OFF+2 ; ROM address ENDIF JMP 32,X1 ; Correct for the circular buffer ADD X1,A L_C32 CMP Y0,A ; Has it been incremented to RCV_BUF + NWORDS? JLT Yes correlated double JSR $6FF WARN 'Internal P: memory overflow!' ENDIF ENDSEC ; End of section COADD ; End of program END