COMMENT * This file is used to generate boot DSP code for the second generation TIMII timing board. This is Rev. 3.00 software. Overlays are no longer used, but application programs can be downloaded. --- Modified 10-30-96 for polling handling of interrupts --- Cleaned up 11-12-96 for operation with EEV39 CCD and Gemini delivery --- Modified not connected parallel ports 1-10-97 to prevent latchup by configuring them as outputs driven high. --- Ported to Rev. 4B timing boards starting Feb. 17, 1997. * PAGE 132 ; Printronix page width - 132 columns ; Define some useful DSP register locations RST_ISR EQU $00 ; Hardware reset interrupt ROM_ID EQU $06 ; Location of program Identification = SWI interrupt START EQU $08 ; Starting address of program RCV_BUF EQU $60 ; Starting address of receiver buffer in X: COM_TBL EQU $80 ; Starting address of command table in X: NUM_COM EQU 40 ; Number of entries in command table ROM_OFF EQU $4000 ; Boot program offset address in EEPROM LD_X EQU $4200 ; Assembler loads X: starting at this EEPROM address RD_X EQU $C600 ; DSP reads X: from this EEPROM address APL_ADR EQU $110 ; Starting P: address of application program APL_LEN EQU $200-APL_ADR ; Maximum length of application program ; Define DSP port addresses RDFO EQU $FFC0 ; Read serial receiver fiber optic contents WRFO EQU $FFC0 ; Write to fiber optic serial transmitter WRLATCH EQU $FFC1 ; Write to timing board latch WRSS EQU $FF80 ; Write clock driver and VP switch states RDAD EQU $FFA0 ; Read A/D datum into DSP RSTWDT EQU $6000 ; Address to reset the timing board watchdog timer BCR EQU $FFFE ; Bus (=Port A) Control Register -> Wait States PBC EQU $FFE0 ; Port B Control Register PBDDR EQU $FFE2 ; Port B Data Direction Register PBD EQU $FFE4 ; Port B Data Register PCC EQU $FFE1 ; Port C Control Register PCDDR EQU $FFE3 ; PortC Data Direction Register PCD EQU $FFE5 ; Port C Data Register IPR EQU $FFFF ; Interrupt Priority Register SSITX EQU $FFEF ; SSI Transmit and Receive data register SSIRX EQU $FFEF ; SSI Transmit and Receive data register SSISR EQU $FFEE ; SSI Status Register CRA EQU $FFEC ; SSI Control Register A CRB EQU $FFED ; SSI Control Regsiter B SSI_TDE EQU 6 ; SSI Transmitter data register empty SSI_RDF EQU 7 ; SSI Receiver data register full LVEN EQU 2 ; Low voltage enable (+/-15 volt nominal) HVEN EQU 3 ; Enable high voltage (+32V nominal) TIM_U_RST EQU 5 ; Timing to utility board reset bit number in U25 PWRST EQU 13 ; Power control board reset RST_FIFO EQU 7 ; Reset FIFO bit number in control latch U25 EF EQU 9 ; FIFO empty flag, low true ; Board status bits, defined at X: clocking out IDLMODE EQU 1 ; Set if need to idle after readout ST_RCV EQU 2 ; Set if FO, cleared if SSI TST_IMG EQU 16 ; Set to generate synthetic test image ; After RESET jump to initialization code ORG P:RST_ISR,P:RST_ISR+ROM_OFF JMP utility board SSI, WW=0 -> 24-bit ; STATUS 0 to 3 = 1, AUX1=1, FD15 = 0 MOVEP #$15F3,X:PBDDR ; Port B Data Direction Register ; Set signals listed in PBD above to outputs ; and SYNC to an input MOVEP #$6002,X:CRA ; SSI programming - no prescaling; ; 24 bits/word; on-demand communications; ; no prescale; 4.17 MHz serial clock rate MOVEP #$3D30,X:CRB ; SSI programming - OF0, OF1 don't apply; ; SC0, SC1, SC2 are inputs; SCK is output; ; shift MSB first; rcv and xmt asynchronous ; wrt each other; gated clock; bit frame ; sync; network mode to get on-demand; ; RCV and TX enabled, RCV and TX interrrupts ; disabled -> Utility board SSI MOVEP #$01E8,X:PCC ; Port C Control Register ; Implement SSI pins STD, SRD, SCK, SC2, SC0. MOVEP #$0007,X:PCD ; Port C Data Register ; TXD = RXD = SCLK = 1 MOVEP #$0007,X:PCDDR ; Port C Data Direction Register ; Set signals listed in PCD above to outputs MOVEP #$0000,X:IPR ; Write to interrupt priority register ; Clear all video processor analog switches to lower their power dissipation BSET #0,X:PBD ; Set H0 for analog boards SSI MOVEP #$0000,X:PCC ; Software reset of SSI BCLR #10,X:CRB ; Change SSI to continuous clock for analog MOVEP #$0160,X:PCC ; Re-enable the SSI DO #500,*+3 ; Wait 8 usec for serial data transmission NOP MOVE #$0C3000,A CLR B MOVE #$100000,X0 MOVE #$001000,X1 DO #15,L_VIDEO ; Fifteen video processor boards maximum MOVEP A,X:SSITX ; Gain, integrate speed ADD X0,A MOVE B,X:WRSS ADD X1,B DO #500,*+3 ; Wait 8 usec for serial data transmission NOP NOP L_VIDEO MOVEP #$0000,X:PCC ; Software reset of SSI BSET #10,X:CRB ; Change SSI to gated clock for utility board MOVEP #$0160,X:PCC ; Enable the SSI BCLR #0,X:PBD ; Clear H0 for utility board SSI ; Initialize X: data memory MOVE #RD_X,R0 ; Starting X: address in EEPROM MOVE #0,R1 ; Put values starting at beginning of X: DO #$100,X_MOVE ; Assume 256 = $100 values exist DO #3,X_LOOP ; Reconstruct bytes to 24-bit words MOVE P:(R0)+,A2 ; Get one byte from EEPROM REP #8 ASR A ; Shift right 8 bits NOP ; DO loop restriction X_LOOP MOVE A1,X:(R1)+ ; Write 24-bit words to X: memory X_MOVE ; Reset the Utility board to force it to re-boot BCLR #TIM_U_RST,X:$1FF WARN 'Internal P: memory overflow!' ; Don't overflow DSP P: space ENDIF ; **************** Beginning of command execution code ****************** ; Start the code in the interrupt vector area that is not used ORG P:START,P:START+ROM_OFF ; Program start at P:$18 ; Return here after executing each command MOVE #APL_ADR WARN 'Boot program is too big!' ; Make sure application code ENDIF ; will not be overwritten ; ********* Beginning of X: definitions ************ ; Status and header processing words ORG X:0,P:LD_X STATUS DC 0 ; Status word LATCH DC $E2 ; Value in latch chip U25 HDR DC 0 ; Header for all commands NWORDS DC 0 ; Number of words in command ; Miscellaneous constant definitions ZERO DC 0 ONE DC 1 TWO DC 2 THREE DC 3 SEVEN DC 7 EIGHT DC 8 C780 DC $780 ; EEPROM space per application program C50000 DC 50000 ; Delay for WRROM = 12 millisec MASK1 DC $FCFCF8 ; Mask for checking header MASK2 DC $030300 ; Mask for checking header SBRD DC $020000 ; Source Identification number DBRD DC $000200 ; Destination Identification number DMASK DC $00FF00 ; Mask to get destination board number out SMASK DC $FF0000 ; Mask to get source board number out ERR DC 'ERR' ; An error occurred DON DC 'DON' ; Command was fully processed UTL_REQ DC $555555 ; Word for utility requesting SSI service TIM_ACK DC $AAAAAA ; Word for timing acknowledging SSI service TIM_COM DC 4000 ; Timing command timeout, about 2 milliseconds ; Command table resident in X: data memory ; The first part of the command table will be loaded with application commands ORG X:COM_TBL,P:COM_TBL+LD_X DC 0,START,0,START,0,START,0,START ; Space for 32 application DC 0,START,0,START,0,START,0,START ; commands DC 0,START,0,START,0,START,0,START DC 0,START,0,START,0,START,0,START DC 0,START,0,START,0,START,0,START DC 0,START,0,START,0,START,0,START DC 0,START,0,START,0,START,0,START DC 0,START,0,START,0,START,0,START DC 'TDL',TDL ; Test Data Link DC 'RDM',RDMEM ; Read from DSP or EEPROM memory DC 'WRM',WRMEM ; Write to DSP memory DC 'LDA',LDAPPL ; Load application progam from EEPROM to DSP DC 'STP',FINISH ; Put it here as a no op DC 'DON',PRC_RCV ; Nothing special DC 'ERR',PRC_RCV ; Nothing special DC 0,START ; Space for one more instruction ; End of program END