; This file is used to generate DSP boot code for the second generation ; TimII timing board, Rev. 4B. PAGE 132 ; Printronix page width - 132 columns ; Include a header file that defines global parameters INCLUDE "../DSPlib/timhdr.asm" ; After RESET jump to the initialization code ORG P:RST_ISR,P:RST_ISR+ROM_OFF JMP utility board SSI, WW=0 -> 24-bit ; STATUS 0 to 3 = 0, AUX1=1, FD15 = 0, ; LVEN = HVEN = 1, PWRST = 0 MOVEP #$15FF,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 MOVEP #$0007,X:PCD ; Port C Data Register MOVEP #$0007,X:PCDDR ; Port C Data Direction Register ; Set signals listed in PCD above to outputs MOVEP #>2,X:TCSR ; Enable timer interrupts MOVEP #$61A8,X:TCR ; Divide so timer interrupts every millisecond ; 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 ; Initialize the synchronous serial port 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 DSP 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: when not MOVE R0,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 #$3C WARN 'Error: Timer ISR overwitten at P:$3C' ENDIF ORG P:PGM_CON,P:PGM_CON+ROM_OFF ; Step over timer ISR ; Transmit words to the utility board over the SSI XMT_UTL DO X: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 4 ; Status word; IDLEMODE bit is set ; Timer related constants EXP_TIM DC 1000 ; Exposure time (milliseconds), written by host computer EL_TIM DC 0 ; Elapsed exposure time in milliseconds TGT_TIM DC 0 ; TGT_TIM = EXP_TIM at beginning of exposure SV_SR DC 0 ; Save for timer ISR SV_B0 DC 0 ; Save for timer ISR SV_B1 DC 0 ; Save for timer ISR SV_B2 DC 0 ; Save for timer ISR SV_Y1 DC 0 ; Save for timer ISR LATCH DC $F2 ; Starting value in latch chip U25 HDR DC 0 ; Header for all commands NWORDS DC 0 ; Number of words in command IDL_ADR DC 0 ; Address of routine to be executed when idle ; Miscellaneous constant definitions ZERO DC 0 ONE DC 1 TWO DC 2 THREE DC 3 SEVEN DC 7 EIGHT DC 8 EN_SI DC $0160 ; Enable the SSI serial port C DISA_SI DC $0000 ; Disable the SSI serial port C 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 TIM DC $020002 ; Timing board reply header 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. There MUST be exactly 32 commands entered here. *** ;****************************************************************************** ; 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 Command table *** ;****************************************************************************** ; End of program END